// USE THE ARDUINO TO CONTROL THE LIGHTS ON A FIRETRUCK COSTUME int LED = 6; // Light Set #1 controlled on PIN 6 int LED2 = 9; // Light Set #2 controlled on PIN 9 int BUTTON = 4; // Button controlled on PIN 4 // the setup routine runs once when you press reset void setup() { // initialize the digital pin as an output pinMode(LED, OUTPUT); pinMode(LED2, OUTPUT); pinMode(BUTTON,OUTPUT); } // the loop routine runs over and over again forever void loop() { if(digitalRead(BUTTON) == HIGH) // if the button is pressed then run the light sequence { // When a light is set to 'HIGH' the light comes on; if set to 'LOW' the light goes off // ######Quick blinking light sequence##### digitalWrite(LED, HIGH); // Turn on light set #1 delay(60); // Hold for X milliseconds digitalWrite(LED, LOW); // Turn off light set #1 delay(60); // Hold for X milliseconds digitalWrite(LED2, HIGH); // Turn on light set #2 delay(60); // Hold for X milliseconds digitalWrite(LED2, LOW); // Turn off light set #2 delay(60); // Hold for X milliseconds digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); // ######Long blinking light sequence##### digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); digitalWrite(LED, HIGH); delay(200); digitalWrite(LED, LOW); delay(200); digitalWrite(LED2, HIGH); delay(200); digitalWrite(LED2, LOW); delay(200); // ######One set long and one set short light sequence##### digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(50); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(300); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(50); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(300); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(50); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(300); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(50); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(300); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(50); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(300); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(50); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(300); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(300); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(50); digitalWrite(LED2, LOW); delay(100); // ######Quick blinking light sequence##### digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); digitalWrite(LED, HIGH); delay(60); digitalWrite(LED, LOW); delay(60); digitalWrite(LED2, HIGH); delay(60); digitalWrite(LED2, LOW); delay(60); // ######Very slow blinking light sequence##### digitalWrite(LED, HIGH); delay(800); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(800); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(800); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(800); digitalWrite(LED2, LOW); delay(100); digitalWrite(LED, HIGH); delay(800); digitalWrite(LED, LOW); delay(100); digitalWrite(LED2, HIGH); delay(800); digitalWrite(LED2, LOW); delay(100); //Force all lights off before looping (just in case I messed something up) digitalWrite(LED, LOW); digitalWrite(LED2, LOW); } }