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