Happy Birthday Music Arduino Code
Happy Birthday Music Arduino Code
'x', 'y' };
655 , 715 };
int SPEE = 5;
if (names[i] == note) {
int newduration = duration/SPEE;
playTone(tones[i], newduration);
}
}
}
void setup() {
pinMode(speakerPin, OUTPUT);
}
void loop() {
for (int i = 0; i < length; i++) {
if (notes[i] == ' ') {
delay(beats[i] * tempo); // delay between notes
} else {
playNote(notes[i], beats[i] * tempo);
}
// time delay between notes
delay(tempo);
}
}