Fur Elise With Flashing Lights

575

9

2

In this tutorial, you will learn to use a Piezo speaker or a buzzer and some LEDs to create a flashing lights display while Fur Elise plays. It will help to learn how to use a breadboard , and you will encounter upload errors, so Arduino support should be able to help you.

Step 1: Materials

For this project, you will need:

- 14 LEDs

- >25 connectors

- 1 piezo or buzzer

- Breadboard

- Arduino Uno R3

Step 2: Assembly

To assemble the circuit, begin by placing the Arduino next to the breadboard, both "portrait style" and connecting any ground to the "-" portion of the board. Then, place LEDs with the [longer] anode lead in holes 1, 3, 5, 7, 9, 11 and 13 in both the 'd' row and in the 'i' row. This will use 14 LEDs. Connect the first LED in the 'i' row to pin 13 on the Arduino, then follow with the second LED in the 'i' row to pin 12 and the third to pin 11. Next, connect the fourth to pin 6, the fifth to pin 9, the sixth to pin 8, and the seventh LED to pin 7. Between the two rows of LEDs bridge the gap between the two as shown in the diagram. Then, on each 'i' row LED, connect jumpers from the ''-'' row to the LED cathodes. Place the piezo or buzzer anywhere you want it and connect the ground to the side with no marking and connect pin 10 to the side with a "+" marking. Now your circuit is ready to program.

Step 3: Programming

Connect the Arduino to the USB port so it can be programmed. Then upload the code from the next step to the Arduino.

Step 4: The Code

Then, copy and paste the following code to the Arduino:

Please let me know if you encounter problems with the code.


const int LED = 13; //led to pin 13 const int LEDa = 12; const int LEDb = 11; const int LEDc = 6; const int LEDe = 9; const int LEDf = 8; const int LEDg = 7; void setup() { pinMode(10, OUTPUT); pinMode(LED, OUTPUT); pinMode(LEDa, OUTPUT); pinMode(LEDb, OUTPUT);//pin 11 as an output pinMode(LEDc, OUTPUT); pinMode(LEDe, OUTPUT); pinMode(LEDf, OUTPUT); pinMode(LEDg, OUTPUT); }

void loop() { // play e4 delay(600); tone(10, 329.63, 300); delay(350); // play d4# tone(10, 311.13, 300); delay(350); // play e4 tone( 10, 329.63, 300); delay(350); // play d4# tone( 10,311.13, 300); delay(350); // play e4 tone(10, 329.63, 300); delay(350); // play b3 tone( 10, 246.94, 300); delay(400); // play d4 tone(10, 293.66,300); delay(400); // play c4 tone(10, 261.63,300); delay(400); // play a3 tone(10, 220, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play d3 tone(10,146.83, 300); delay(350); //play f3 tone(10, 174.61, 300); delay(400); //play a3 tone(10, 220, 300); delay(400); // play b3 tone(10, 246.94, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play e3 tone(10, 164.81, 300); delay(400); // play g3# tone(10, 207.65, 300); delay(400); // play b3 tone(10, 246.94, 300); delay(400); // play c4 tone(10, 261.63, 900); delay(1000); delay(300); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); //play e3 tone(10,164.81, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play d4# tone(10, 311.13, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play d4# tone(10, 311.13, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play b3 tone(10, 246.94, 300); delay(400); // play d4 tone(10, 293.66, 300); delay(400); // play c4 tone(10, 261.63, 300); delay(400); // play a3 tone(10, 220, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play d3 tone(10, 146.83, 300); delay(400); // play f3 tone(10, 174.61, 300); delay(400); // play a3 tone(10, 220, 300); delay(400); // play b3 tone(10, 246.94, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play f3 tone(10, 174.61, 300); delay(400); // play c4 tone(10, 261.63, 300); delay(400); // play b3 tone(10, 246.94, 300); delay(400); // play a3 tone(10, 220, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play b3 tone(10,246.94, 300); delay(400); // play c4 tone(10, 261.63, 300); delay(400); // play d4 tone(10, 293.66, 300); delay(400); // play e4 tone(10, 329.63, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play g3 tone(10, 196, 300); delay(400); // play f4 tone(10, 349.23, 300); delay(400); //play e4 tone(10, 329.23, 300); delay(400); // play d4 tone(10, 293.63, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play e3 tone(10,164.81, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play d4 tone(10, 293.63, 300); delay(400); // play c4 tone(10, 261.63, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play d3 tone(10, 146.83, 300); delay(400); // play d4 tone(10, 293.63, 300); delay(400); // play c4 tone(10, 261.63, 300); delay(400); // play b3 tone(10, 246.94, 900); delay(1000); delay(400); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play e4 tone(10, 329.63, 300); delay(400); // play d4# tone(10, 311.13, 300); delay(350); // play e4 tone( 10, 329.63, 300); delay(350); // play d4# tone( 10,311.13, 300); delay(350); // play e4 tone(10, 329.63, 300); delay(350); // play b3 tone( 10, 246.94, 300); delay(400); // play d4 tone(10, 293.66,300); delay(400); // play c4 tone(10, 261.63,300); delay(400); // play a3 tone(10, 220, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play d3 tone(10,146.83, 300); delay(350); //play f3 tone(10, 174.61, 300); delay(400); //play a3 tone(10, 220, 300); delay(400); // play b3 tone(10, 246.94, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play e3 tone(10, 164.81, 300); delay(400); // play g#3 tone(10, 207.65, 300); delay(400); // play b3 tone(10, 246.94, 300); delay(400); // play c4 tone(10, 261.63, 900); delay(1000); delay(300); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); //play e3 tone(10, 164.81, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play d4# tone(10, 311.13, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play d4# tone(10, 311.13, 300); delay(400); // play e4 tone(10, 329.63, 300); delay(400); // play b3 tone(10, 246.94, 300); delay(400); // play d4 tone(10, 293.66, 300); delay(400); // play c4 tone(10, 261.63, 300); delay(400); // play a3 tone(10, 220, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play d3 tone(10, 146.83, 300); delay(400); // play f3 tone(10, 174.61, 300); delay(400); // play a3 tone(10, 220, 300); delay(400); // play b3 tone(10, 246.94, 900); delay(1000); digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); // play f3 tone(10, 174.61, 300); delay(400); // play c4 tone(10, 261.63, 300); delay(400); // play b3 tone(10, 246.94, 300); delay(400); // play a3 tone(10, 220, 900); delay(1000);

digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40);

} [/code]

Step 5: The End

I hope you enjoyed this tutorial. Now, you have a new appreciation for the integrated circuits inside of singing cards. You also have a gadget that plays Fur Elise and flashes lights.

Step 6: Additional Code:

If you want your lights to flash and sing Happy Birthday, upload the following code when your Arduino is plugged into the USB port.

//code runs flashing wave LEDS and buzzer buzzes 'happy birthday'

const int LED = 13; //led to pin 13 const int LEDa = 12; const int LEDb = 11; const int LEDc = 6; const int LEDe = 9; const int LEDf = 8; const int LEDg = 7;

const int buzzer = 10; //buzzer to arduino pin 9

void setup() { pinMode(LED, OUTPUT); pinMode(LEDa, OUTPUT); pinMode(LEDb, OUTPUT);//pin 11 as an output pinMode(LEDc, OUTPUT); pinMode(LEDe, OUTPUT); pinMode(LEDf, OUTPUT); pinMode(LEDg, OUTPUT); pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output

}

void loop(){ tone(buzzer, 261.6); // Send 1KHz sound signal... delay(300); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 261.6); // Send 1KHz sound signal... delay(100); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 293.665); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 261.6); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 349.23); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 329.63); // Send 1KHz sound signal... delay(800); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec digitalWrite(LED, HIGH); delay(40);//set led to high, delay 40ms digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW);//turn led off, delay 40 ms delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); tone(buzzer, 261.6); // Send 1KHz sound signal... delay(300); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 261.6); // Send 1KHz sound signal... delay(100); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 293.665); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 261.6); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 392); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 349.23); // Send 1KHz sound signal... delay(800); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec digitalWrite(LED, HIGH); delay(40); digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW); delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); tone(buzzer,261.63); // Send 1KHz sound signal... delay(300); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer,261.63 ); // Send 1KHz sound signal... delay(100); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 523.25); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 440); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 349.23); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 329.63); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 293.66); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec digitalWrite(LED, HIGH); delay(40); digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW); delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); tone(buzzer,466.16); // Send 1KHz sound signal... delay(300); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 466.16); // Send 1KHz sound signal... delay(100); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for tone(buzzer, 440); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec tone(buzzer, 349.23); // Send 1KHz sound signal... delay(400); // ...for 1 sec noTone(buzzer); // Stop sound... delay(200); // ...for 1sec digitalWrite(LED, HIGH); delay(40); digitalWrite(LEDa, HIGH); delay(40); digitalWrite(LEDb, HIGH); delay(40); digitalWrite(LEDc, HIGH); delay(40); digitalWrite(LEDe, HIGH); delay(40); digitalWrite(LEDf, HIGH); delay(40); digitalWrite(LEDg, HIGH); delay(40); digitalWrite(LED, LOW); delay(40); digitalWrite(LEDa, LOW); delay(40); digitalWrite(LEDb, LOW); delay(40); digitalWrite(LEDc, LOW); delay(40); digitalWrite(LEDe, LOW); delay(40); digitalWrite(LEDf, LOW); delay(40); digitalWrite(LEDg, LOW); delay(40); tone(buzzer, 392); delay(400); noTone(buzzer); delay(200); tone(buzzer, 349.23); delay(1000); noTone(buzzer); // Stop sound... delay(200); // ...for 1sec }

Share

    Recommendations

    • Plastics Contest

      Plastics Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Optics Contest

      Optics Contest

    2 Discussions

    0
    None
    Electro Art

    10 months ago

    you definetely should put a video of this :)

    0
    None
    DIY Hacks and How Tos

    10 months ago

    This would be a great way to set up some kind of Christmas display.