Difference between revisions of "Switch and LED with PIC16F877A Starter Board"
(4 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
[[Category:Starter PIC16F877]] | [[Category:Starter PIC16F877]] | ||
− | In this tutorial we will learn how to | + | In this tutorial we will learn how to ON OFF LED with Switch on PIC16F877 Starter Board.<br> |
− | The Explore Starter PIC board has two on board LED's which are connected to | + | The Explore Starter PIC board has two on board LED's which are connected to PORTD.0 & PORTD.1 and two on board Switches which are connected to PORTD.2 & PORTD.3. <br><br> |
=Steps= | =Steps= | ||
− | #Configure the | + | #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= | =Code= | ||
Line 14: | Line 15: | ||
=Demo= | =Demo= | ||
− | [[File: | + | [[File:PIC16f877A LED Switch.gif]]<br><br> |
Latest revision as of 18:28, 2 May 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 PORTD.0 & PORTD.1 and two on board Switches which are connected to PORTD.2 & PORTD.3.
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