#define BUZZER 2
int n_notes = 8;
int C =262;
int D =294;
int E =330;
int F =349;
int G =392;
int A =440;
int B =494;
int C_H =523;
int notes[] = {C,D,E,F,G,A,B,C_H};
void setup() {
// put your setup code here, to run once:
pinMode(BUZZER, OUTPUT);
for (int i=0; i<8;i++)
{
tone(BUZZER,notes[i]);
delay(500);
noTone(BUZZER);
delay(2);
}
for (int i=8; i>0;i--)
{
tone(BUZZER,notes[i]);
delay(500);
noTone(BUZZER);
delay(2);
}
}
void loop() {
// put your main code here, to run repeatedly:
// this speeds up the simulation
}