int song[] ={
262,262,294,262,349,330,
262,262,294,262,392,349,
262,262,523,440,349,330,294,
494,494,440,349,392,349
};
int noteDurations[] = {
4,4,2,2,2,1,
4,4,2,2,2,1,
4,4,2,2,2,2,2,
4,4,2,2,2,1
};
void setup() {
for (int thisNote = 0; thisNote<25;thisNote++)
{
int noteDuration = 1000/noteDurations[thisNote];
tone(8, song[thisNote],noteDuration);
int pauseBetweenNotes = noteDuration *1.30;
delay(pauseBetweenNotes);
noTone(8);
}
}
void loop() {
setup();
}
Comments
Please log in or sign up to comment.