#define BUZ_PIN 3
int notes[] = {
695, 622, 659, 622, 659, 987, 587, 523, 440,
261, 329, 440, 493, 329, 415, 493, 523, 329,
659, 622, 659, 622, 659, 987, 587, 523, 440,
261, 329, 440, 493, 349, 523, 493, 440
};
int times[] = {
250, 250, 250, 250, 250, 250, 250, 250, 500,
250, 250, 250, 500, 250, 250, 250, 500,
250, 250, 250, 250, 250, 250, 250, 250, 250,
500, 250, 250, 250, 500, 250, 250, 250, 1000
};
void setup() {
pinMode(BUZ_PIN, OUTPUT);
}
void loop() {
for (int i = 0; i < 35; i++) {
tone(BUZ_PIN, notes[i]);
delay(times[i]);
noTone(BUZ_PIN);
}
}