/*
Police Chaser Lights
Author: Jista Awesome
Date: December 2, 2016
This program flashes the middle red and blue LED and the LED directly to the left of
each color. Then flashes the middle red and blue LED as well as the LED directly to the
Right of each color.
*/
// the setup function runs once when you press reset or power the board
void setup() {
// RED LED's < >BLUE LED's
// initialize digital pin 13, 12, 11, 10, 9, 8 as an output.
pinMode(13, OUTPUT); //Left Red
pinMode(12, OUTPUT); //Middle Red
pinMode(11, OUTPUT); //Right Red
pinMode(10, OUTPUT); //Left Blue
pinMode(9, OUTPUT); //Middle Blue
pinMode(8, OUTPUT); //Right Blue
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH);
digitalWrite(12, HIGH);
digitalWrite(10, HIGH);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(13, LOW);
digitalWrite(12, LOW);
digitalWrite(10, LOW);
digitalWrite(9, LOW);
delay(100);
/////LED Alternate sides/////
digitalWrite(11, HIGH);
digitalWrite(12, HIGH);
digitalWrite(8, HIGH);
digitalWrite(9, HIGH);
delay(100);
digitalWrite(11, LOW);
digitalWrite(12, LOW);
digitalWrite(8, LOW);
digitalWrite(9, LOW);
delay(100);
}
Comments