I want to toggle on and off an LED when I press a button, I want it to turn on when I press it and I want it to turn off when I press it again. It also has to repeat so I can do it over and over again.
If someone could please give me some code examples it would really help me out.
THANK YOU
ALLEN
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Wed Dec 31, 2008 2:45 pm
See the program below. This will flash an LED on and off. That's a good
place to start. Connect a series resistor and an LED to pin B2.
Look at Figure 5 (on page 2) of the link below to see a schematic of the
LED and resistor circuit. Do it the same way, except use pin B2 instead
of pin B0. You can use a resistor from 220 to 470 ohms. I assume your
PIC is running at +5v.
http://www.siriusmicro.com/projects/b2.pdf
Then try this program:
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum