int buzzer = 32;
int PB = 22;
void setup() {
// put your setup code here, to run once:
pinMode(buzzer, OUTPUT);
pinMode(PB, INPUT_PULLDOWN);
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
if (digitalRead(PB) == HIGH){
tone(buzzer, 100);
}else{
tone(buzzer, 0);
}
}