Simple Arduino L.E.D Police Lights

 by dave1324
DSC02225.JPG

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 adsRemove these ads by Signing Up

Step 1: You will need.

DSC02225.JPG
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
KegRaider says: Sep 14, 2012. 8:19 PM
I found a slight error in the code. Pretty easy to fix, but a total n00b may not know where it is....

[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
Crimson13 says: Dec 23, 2010. 4:43 PM
Great instrucable. I'm working on an emergency led lighting system, so this comes in handy.

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.
Wally_Z in reply to Crimson13May 10, 2012. 5:01 AM
I have been researching flash patterns to use with my Arduino, and I have found that this works fairly good:

-Red flashes 3 times (50ms on, 50ms off)
-Blue flashes 3 times (50ms on, 50ms off)
-Alternating flashes of each (back and forth)
Wally_Z in reply to Crimson13May 10, 2012. 5:01 AM
I have been researching flash patterns to use with my Arduino, and I have found that this works fairly good:

-Red flashes 3 times (50ms on, 50ms off)
-Blue flashes 3 times (50ms on, 50ms off)
-Alternating flashes of each (back and forth)
krzxsiek says: Sep 14, 2010. 12:47 PM
it's very cool simple effect :) thanks ;]
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!