#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
}
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT