This was one of the first programs i wrote for the arduino after having it a few days :)
we will be making l.e.d police lights with minimal materials
Remove these ads by
Signing UpStep 1: You will need.
Arduino (or suitable clone)
Breadboard
2x 240ohm resistors
1x Clear Red l.e.d
1x Clear Blue l.e.d
Some Jumper Cables




































Visit Our Store »
Go Pro Today »




[quoted code]
digitalWrite(redPin, :LOW); // turn the red light off
delay(ledDelay); // wait 50 ms
delay(100); // delay midpoint by 100ms
[/quoted code]
Basically, take out the : from before the LOW command. ;)
Other than that, my young boy loves the lights, thanks.
-KegRaider
One thing I would suggest for a smoother pattern, is to add another delay of 100ms at the end of your loop.
Right now it loops from blue-off to red-on without a delay, but the opposite has the 100ms delay at the midpoint. Adding that same midpoint delay at the end will make everything balance out.
-Red flashes 3 times (50ms on, 50ms off)
-Blue flashes 3 times (50ms on, 50ms off)
-Alternating flashes of each (back and forth)
-Red flashes 3 times (50ms on, 50ms off)
-Blue flashes 3 times (50ms on, 50ms off)
-Alternating flashes of each (back and forth)