#include "pitches.h"
// notes in the melody:
int melody[] = {
NOTE_C5, NOTE_C5, NOTE_C5, NOTE_F5, NOTE_F5, NOTE_G5, NOTE_G5, NOTE_C6, NOTE_A5, NOTE_F5, NOTE_F5,
NOTE_A5, NOTE_F5, NOTE_D5, NOTE_AS5, NOTE_G5, NOTE_E5, NOTE_F5
};
int duration = 400; // 400 miliseconds
void setup() {
}
void loop() {
for (int thisNote = 0; thisNote < 18; thisNote++) {
// pin8 output the voice, every scale is 0.5 sencond
tone(8, melody[thisNote], duration);
// Output the voice after several minutes
delay(500);
}
// restart after two seconds
delay(2000);
}