from machine import Pin
import time
LED_PIN = 3
BUTTON_PIN = 28
buzzer = Pin(LED_PIN, Pin.OUT)
button = Pin(BUTTON_PIN,Pin.IN,Pin.PULL_UP)
while True:
if not button.value():
buzzer.on()
time.sleep(0.5)
else:
buzzer.off()
time.sleep(0.5)