#define BUZZER 2
#define PUSH 3
void setup() {
// put your setup code here, to run once:
pinMode(BUZZER, OUTPUT);
pinMode(PUSH, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(PUSH) == LOW){
tone(BUZZER, 500);
delay(100);
}else{
tone(BUZZER, 0);
delay(100);
}
delay(1); // this speeds up the simulation
}