LED COP LIGHTS USING ARDUINO!

by GoRotics in Circuits > LEDs

2773 Views, 24 Favorites, 0 Comments

LED COP LIGHTS USING ARDUINO!

led cop lights.jpg

Here's a video showing cop lights in action.

Components Required

blog.jpg
breadboard.jpg
lrd red.jpg
blue led.jpg
jumper wires.jpg
  1. Micro controller(I used arduino Uno)
  2. Breadboard
  3. Red LED's(Or any colour you like)
  4. Blue LED's
  5. Connecting wires

Thats all

Now lets start working :)

Making the Connections

cop lights.png

Here is a circuit diagram,its not necessary to explain this its self explanatory

The pin 11 of arduino is connected to the positive terminal of the Blue LED

pin 9 is connected to the positive terminal of Red LED

the grounds are kept common and are connected to the GND pin

Uploading the Code

Here's the code you need to upload on the arduino

int ledDelay = 50; // delay by 50ms
int redPin = 9;

int bluePin = 11;

void setup()

{

pinMode(redPin, OUTPUT);

pinMode(bluePin, OUTPUT);

}

void loop()

{

digitalWrite(redPin, HIGH); // turn the red light on

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, LOW); // turn the red light off

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, HIGH); // turn the red light on

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, LOW); // turn the red light off

delay(ledDelay); // wait 50 ms

digitalWrite(redPin, HIGH); // turn the red light on

delay(ledDelay); // wait 50 ms

digitalWrite(redPin,LOW); // turn the red light off

delay(ledDelay); // wait 50 ms

delay(100); // delay midpoint by 100ms

digitalWrite(bluePin, HIGH); // turn the blue light on

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, LOW); // turn the blue light off

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, HIGH); // turn the blue light on

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, LOW); // turn the blue light off

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, HIGH); // turn the blue light on

delay(ledDelay); // wait 50 ms

digitalWrite(bluePin, LOW); // turn the blue light off

delay(ledDelay); // wait 50 ms

}

Downloads

You Are Done!

Yes you are done enjoy!