Hackster is hosting Hackster Holidays, Ep. 4: Livestream & Giveaway Drawing. Start streaming on Wednesday!Stream Hackster Holidays, Ep. 4 on Wednesday!
technoesolution
Published © CC BY-NC-ND

Astronomia Coffin Dance Song Using Arduino & Buzzer

In this tutorial we are going to play astronomia coffin dance song using Arduino & Buzzer, Let's fun with Arduino.

BeginnerFull instructions provided30 minutes18,522
Astronomia Coffin Dance Song Using Arduino & Buzzer

Things used in this project

Story

Read more

Schematics

Circuit Diagram

Follow Circuit Diagram to make connection.

Arduino To Buzzer

D10 > +ve
GND > -ve

Code

Arduino Code

C/C++
Simply Copy the following code & upload in your Arduino IDE software.
// Hello friends Welcome to "TECHNO-E-SOLUTION"
// Here is the code for Coffin Song

#include <pitches.h>

// output pin is 10, you can change it down in the void setup.
#include "pitches.h"

int melody[] = {
NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4,
NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4,
NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4,
NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4,
NOTE_AS4, NOTE_AS4, NOTE_AS4, NOTE_AS4,
NOTE_D5, NOTE_D5, NOTE_D5, NOTE_D5,
NOTE_C5, NOTE_C5, NOTE_C5, NOTE_C5, 
NOTE_F5, NOTE_F5, NOTE_F5, NOTE_F5, 
NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5,
NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, 
NOTE_G5, NOTE_G5, NOTE_G5, NOTE_G5, 
NOTE_C5, NOTE_AS4, NOTE_A4, NOTE_F4,
NOTE_G4, 0, NOTE_G4, NOTE_D5,
NOTE_C5, 0, NOTE_AS4, 0,
NOTE_A4, 0, NOTE_A4, NOTE_A4,
NOTE_C5, 0, NOTE_AS4, NOTE_A4, 
NOTE_G4,0, NOTE_G4, NOTE_AS5,
NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5,
NOTE_G4,0, NOTE_G4, NOTE_AS5,
NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5,
NOTE_G4, 0, NOTE_G4, NOTE_D5,
NOTE_C5, 0, NOTE_AS4, 0,
NOTE_A4, 0, NOTE_A4, NOTE_A4,
NOTE_C5, 0, NOTE_AS4, NOTE_A4, 
NOTE_G4,0, NOTE_G4, NOTE_AS5,
NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5,
NOTE_G4,0, NOTE_G4, NOTE_AS5,
NOTE_A5, NOTE_AS5, NOTE_A5, NOTE_AS5

};

int noteDurations[] = {
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
4,4,4,4,
};

void setup() {

}
void loop() 
{
for (int thisNote = 0; thisNote < 112; thisNote++) 
{

int noteDuration = 750 / noteDurations[thisNote];
tone(10, melody[thisNote], noteDuration);

int pauseBetweenNotes = noteDuration * 1.30;
delay(pauseBetweenNotes);

noTone(10);}
}

Credits

technoesolution

technoesolution

23 projects • 15 followers
Youtuber | Electrical Engineer | Electronics Lover | Article Writer | Project Developer |

Comments