Arduino-L.E.D-Police-Lights-circuit

Simple Arduino L.E.D Police Lights

Simple Arduino L.E.D Police Lights

Arduino (or suitable clone)
Breadboard

Components
2x 330ohm resistors
1x Clear Red l.e.d
1x Clear Blue l.e.d

Price of components in Nepal = 24npr

Some Jumper Cables

Code to be uploaded on to the Arduino

// Project 1 – Police Lights by Dave1324

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

void setup() {
pinMode(redPin, OUTPUT);
pinMode(bluePin, OUTPUT);

}

Arduino L.E.D Police Lights circuit
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

}

 

Arduino-L.E.D-Police-Lights-circuit
Arduino-L.E.D-Police-Lights-circuit