from machine import Pin
from time import sleep

led = Pin(10, Pin.OUT, Pin.PULL_DOWN)
sw = Pin(21, Pin.IN)

while True:
  if sw.value() == 1:
    led.value(1)
    print(sw.value())
    sleep(0.1)
  else:
    led.value(0)
    print(sw.value())
    sleep(0.1)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT