# control buuzer
from machine import Pin
from time import sleep
# configure LED Pin
buzzer=Pin(2, Pin.OUT)
led=Pin(15, Pin.OUT)
button=Pin(14, Pin.IN, Pin.PULL_DOWN)
while True:
if button.value()==1:
led.value(1) #turn on LED
buzzer.value(1) #turn on buzzer
sleep(0.2)
led.value(0) #turn off Led
buzzer.value(0) #turn off buzzer