Go Down

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



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.



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:

Some of my projects:
Shield for DS1337+, DS1624 and AT24C1024B (RTC, temp & mem): http://forum.arduino.cc/index.php/topic,126197.0.html
CHDK Camera remote shutter (BT, IR, USB): http://forum.arduino.cc/index.php?topic=295377.0

Go Up