#include <Arduino.h>
const int BUZZER_PIN = 18;
int melody[] = {
392.00, 440.00, 392.00, 349.23,
329.63, 392.00, 440.00, 392.00,
349.23, 329.63,
293.66, 329.63, 349.23,
392.00, 440.00, 392.00,
349.23, 329.63,
392.00, 523.25
};
int noteDurations = 500;
void setup() {
pinMode(BUZZER_PIN, OUTPUT);
}
void loop() {
for (int i = 1; i < 20; i++) {
tone(BUZZER_PIN, melody[i], noteDurations);
delay(noteDurations * 1.30);
}
noTone(BUZZER_PIN);
delay(2000);
}