Line 1: Line 1:
 
[[Category:PIC Tutorials]]
 
[[Category:PIC Tutorials]]
[http://exploreembedded.com/wiki/images/6/6f/Schematic_PIC_Interupt.pdf '''Schematic''']
+
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 PORTD.0 & PORTD.1 and two on board Switches which are connected to PORTD.2 & PORTD.3. <br><br>
  
[[File:Schematic PIC Interupt.JPG|680px]]
+
=Steps=
<span style="color:red">'''Code and Explanation will be updated soon..'''</span>
+
#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=
 +
<html>
 +
<script src="https://gist.github.com/sharanago/0d6c8619bc40351dd7a3d476f7f82840.js"></script>
 +
</html>
 +
 
 +
=Demo=
 +
[[File:PIC16f877A LED Switch.gif]]<br><br>

Revision as of 16:22, 3 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

  1. Configure the PORT D0 as output .
  2. Configure the PORT D2 as input.
  3. Read the switch status.
  4. ON/OFF the led as per switch status.

Code

Demo

PIC16f877A LED Switch.gif