from machine import Pin
from time import sleep
btn=Pin(0,Pin.IN)
led=Pin(1,Pin.OUT)
while(1):
    print(btn.value())
    if btn.value() == 1 :
        led.on()
    else:
        led.off()
    sleep(.5)



BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT