New Year Mini Ball Drop Arduino Code

Copy paste everything below this line into the Arduino software:

/*
* New Year Mini Ball Drop LED Timer By Dino Segovis @MakerDino
* Five LEDs outputs light up in sequence over a one minute period followed by the
* the playing of AuldLang Syne.
*
*/

int led1 = 1; // LED connected to digital pin 1
int led2 = 2; // LED connected to digital pin 2
int led3 = 3; // LED connected to digital pin 3
int led4 = 4; // LED connected to digital pin 4
int led5 = 5; // LED connected to digital pin 5
int led6 = 6; // LED connected to digital pin 6
int button1 = 7;

void setup() // run once, when the sketch starts
{
pinMode(led1, OUTPUT); // sets the digital pin1 as output
pinMode(led2, OUTPUT); // sets the digital pin2 as output
pinMode(led3, OUTPUT); // sets the digital pin3 as output
pinMode(led4, OUTPUT); // sets the digital pin4 as output
pinMode(led5, OUTPUT); // sets the digital pin5 as output
pinMode(led6, OUTPUT); // sets the digital pin6 as output
pinMode(button1, INPUT); // sets the digital pin6 as output
}

void loop() // run over and over again
{

digitalWrite(led1, HIGH); // sets the LED on
delay(14950); // waits for approx 15 second
digitalWrite(led1, LOW); // sets the LED off
delay(50); // quick delay

digitalWrite(led2, HIGH); // sets the LED on
delay(14950); // waits for approx 15 second
digitalWrite(led2, LOW); // sets the LED off
delay(50); // quick delay

digitalWrite(led3, HIGH); // sets the LED on
delay(14950); // waits for approx 15 second
digitalWrite(led3, LOW); // sets the LED off
delay(50); // quick delay

digitalWrite(led4, HIGH); // sets the LED on
delay(14950); // waits for approx 15 second
digitalWrite(led4, LOW); // sets the LED off
delay(50); // quick delay

digitalWrite(led5, HIGH); // sets the LED on for 60 seconds
digitalWrite(led6, HIGH); // sets the LED on for 60 seconds
/////////////////////////////////////////////////////////////////////////
// Music section
tone(8, 262);
delay(400);
tone(8, 349);
delay(600);
tone(8, 330);
delay(200);
tone(8, 349);
delay(400);
tone(8, 440);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(580);
noTone(8);
delay(20);
tone(8, 349);
delay(200);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(940);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(1000);
// End Phrase B
//////////////////////
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(1000);
noTone(8);
delay(20);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
/////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(940);
// End Phrase B
noTone(8);
delay(2000);
//////////////////////////////////////////////////////
// Music section
tone(8, 262);
delay(400);
tone(8, 349);
delay(600);
tone(8, 330);
delay(200);
tone(8, 349);
delay(400);
tone(8, 440);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(580);
noTone(8);
delay(20);
tone(8, 349);
delay(200);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(940);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(1000);
// End Phrase B
//////////////////////
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(1000);
noTone(8);
delay(20);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
/////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(940);
// End Phrase B
noTone(8);
delay(2000);
//////////////////////////////////////////////////////
// Music section
tone(8, 262);
delay(400);
tone(8, 349);
delay(600);
tone(8, 330);
delay(200);
tone(8, 349);
delay(400);
tone(8, 440);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(580);
noTone(8);
delay(20);
tone(8, 349);
delay(200);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(940);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(1000);
// End Phrase B
//////////////////////
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(1000);
noTone(8);
delay(20);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
/////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(940);
// End Phrase B
noTone(8);
delay(2000);
//////////////////////////////////////////////////////
// Music section
tone(8, 262);
delay(400);
tone(8, 349);
delay(600);
tone(8, 330);
delay(200);
tone(8, 349);
delay(400);
tone(8, 440);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(580);
noTone(8);
delay(20);
tone(8, 349);
delay(200);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(940);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(1000);
// End Phrase B
//////////////////////
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
////////////////////
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 523);
delay(400);
tone(8, 587);
delay(1000);
noTone(8);
delay(20);
// Begin phrase A
noTone(8);
delay(60);
tone(8, 587);
delay(400);
tone(8, 523);
delay(600);
tone(8, 440);
delay(180);
noTone(8);
delay(20);
tone(8, 440);
delay(400);
tone(8, 349);
delay(400);
tone(8, 392);
delay(600);
tone(8, 349);
delay(200);
tone(8, 392);
delay(400);
// End phrase A
/////////////////////
// Begin phrase B
tone(8, 440);
delay(200);
tone(8, 392);
delay(200);
tone(8, 349);
delay(600);
tone(8, 294);
delay(180);
noTone(8);
delay(20);
tone(8, 294);
delay(400);
tone(8, 262);
delay(400);
tone(8, 349);
delay(940);
// End Phrase B
noTone(8);
delay(2000);
//////////////////////////////////////////////////////

delay(60000);
digitalWrite(led5, LOW); // sets the LED off
digitalWrite(led6, LOW); // sets the LED off
delay(50); // quick delay

}

Leave a Reply