Go Down

Topic: can i flash different LED program on the arduino uno at the same time (Read 342 times) previous topic - next topic

rob100

Hi

I just need some help. I have a two LED on a bread board one LED is connected to pin 7 and the other to pin 4. I need pin 7 to run a delay 4000 and pin 4 to run a delay of 1000. can i program the arduino to do this or is it just one at a time.

thanks.

AlxDroidDev

Yes, easily. You just won't use the delay() function for that. Instead you'll use the millis() function.

Take a look at this tutorial: http://arduino.cc/en/Tutorial/BlinkWithoutDelay

You'll adapt it to control 2 LEDs, however, and have 2 time control variables.

In fact, Nick Gammon has done a sketch that does just that:

http://www.gammon.com.au/forum/?id=11411
Learn to live: Live to learn.
Showing off my work: http://arduino.cc/forum/index.php/topic,126197.0.html


Go Up