Push Button as Input and Led as Output with Pic Microcontroller

This is a simple tutorial/project on how to interface a transistor (2n2222), led and push button with Pic microcontroller. In the project i am going to switch on and off(blink) an led with the help of a push button. Since transistors are used at outputs we can drive heavy loads with the same circuit. Pic16f877 microcontroller is used in the project. Port-B of Pic16f877 is used as output port. Port-B of pic1 ...

Read more

Using Push Button Switch – MPLAB XC8

I hope that you already go through the first tutorial of MPLAB XC8, Getting Started with MPLAB XC8 – LED Blinking. In that tutorial we learn how to use an output pin by driving an LED. In this we will learn how to read an Input pin using a push button switch. We already seen that TRIS register is used to set direction of each IO pin, ie Input or Output and PORT register is used to read or write status of an ...

Read more
Scroll to top