import time
import machine
time.sleep(0.1) # Wait for USB to become ready
led=machine.Pin(0,machine.Pin.OUT)
button=machine.Pin(28,machine.Pin.IN,machine.Pin.PULL_UP)
while 1:
state=button.value()
if state==0:
led.value(1)
elif state==1:
led.value(0)
time.sleep(0.1)