LED COP LIGHTS USING MICRO-CONTROLLER (ARDUINO) !!

LED COP LIGHTS USING MICRO-CONTROLLER (ARDUINO)  !!


STEP 1: Things You Will Need:


1. Arduino (UNO)



2.Breadboard x1
 3. Blue Led x1


4.Red LED  x 1
 

 5.Jumper wires

STEP 2:CIRCUIT DIAGRAM

 

STEP3: UPLOADING THE CODE

Upload the following code to your 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,L
OW); // 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


}


STEP 4: ENJOY 

Increase or decrease the delay and have fun.

VIDEO

Here's a video showing cops light in action.

 

THANKS FOR WATCHING !! 



Share this

Related Posts

Latest
Previous
Next Post »