#define BUTTON_PIN 2
#define SPEAKER_PIN 9
void setup() {
// put your setup code here, to run once:
pinMode(BUTTON_PIN, INPUT_PULLUP);
pinMode(SPEAKER_PIN, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int y = digitalRead(BUTTON_PIN);
if (y==0){
tone(SPEAKER_PIN, 261.63);
delay(200);
tone(SPEAKER_PIN, 311.13);
delay(200);
noTone(SPEAKER_PIN);
delay(200);
tone(SPEAKER_PIN, 311.13);
delay(200);
tone(SPEAKER_PIN, 261.63);
delay(200);
noTone(SPEAKER_PIN);
delay(200);
tone(SPEAKER_PIN, 261.63);
delay(200);
tone(SPEAKER_PIN, 466.16);
delay(200);
noTone(SPEAKER_PIN);
delay(200);
tone(SPEAKER_PIN, 466.16);
delay(200);
noTone(SPEAKER_PIN);
delay(200);
tone(SPEAKER_PIN, 466.16);
delay(200);
noTone(SPEAKER_PIN);
delay(200);
tone(SPEAKER_PIN, 466.16);
delay(200);
tone(SPEAKER_PIN, 415.3);
delay(200);
noTone(SPEAKER_PIN);
}
}