NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Support Forum » Blinking Leds

October 17, 2011
by nerdgirl
nerdgirl's Avatar

Hello,

I have completed the blinking led project as I have input code for three leds. PC4, PC3, and PC2. I could have input code for all 5 leds but found that three leds was plenty. Works great. Instead of having the leds all blink on/off at the same time, I wish to write code that will allow the three leds to blink one at a time continuously. Kinda like: 1,2,3 then repeat 1,2,3 etc. Would I use a "for" loop or a "while" loop, to accomplish this?

October 17, 2011
by dgikuljot
dgikuljot's Avatar

With microcontrollers, you always want to use a while loop as the main loop.

October 18, 2011
by Ralphxyz
Ralphxyz's Avatar

Nerdgirl, search the forum for "Knight Rider" to get a couple of led blink examples and discussions.

Ralph

October 18, 2011
by nerdgirl
nerdgirl's Avatar

Thanks Ralph. I'll do that. :-)

Post a Reply

Please log in to post a reply.

Did you know that inductors try to keep their current constant over short periods of time? Learn more...