from machine import Pin
import time
button = Pin(5, Pin.IN, Pin.PULL_UP)
led = Pin(1, Pin.OUT) # Change pin number as per your board
while True:
if button.value() == 0:
led.on()
else:
led.off()
time.sleep(0.1)Loading
pi-pico-w
pi-pico-w