import time
time.sleep(0.1) # Wait for USB to become ready
from machine import Pin
button=Pin(16,Pin.IN,Pin.PULL_UP)
led=Pin(27,Pin.OUT)
while True:
btn_val=button.value()
print("button is:",btn_val)
if btn_val==0:
led.on()
elif btn_val==1:
led.off()
time.sleep(0.01)