Difference between revisions of "Switch and LED with PIC16F877A Starter Board"
Line 4: | Line 4: | ||
=Steps= | =Steps= | ||
− | #Configure the PORT D0 as | + | #Configure the PORT D0 as output . |
− | #Configure the PORT D2 as input | + | #Configure the PORT D2 as input. |
#Read the switch status. | #Read the switch status. | ||
#ON/OFF the led as per switch status. | #ON/OFF the led as per switch status. |
Revision as of 16:33, 27 April 2016
In this tutorial we will learn how to ON OFF LED with Switch on PIC16F877 Starter Board.
The Explore Starter PIC board has two on board LED's which are connected to PORT D0 and PORT D1 and two on board Switches which are connected to PORT D2 and PORT D3.
Steps
- Configure the PORT D0 as output .
- Configure the PORT D2 as input.
- Read the switch status.
- ON/OFF the led as per switch status.
Code