from machine import Pin
button = Pin(14, Pin.IN, Pin.PULL_DOWN)
led = Pin(22, Pin.OUT)
while True:
if button.value() == 1:
led.value(1) # Turn on LED when button is pressed
else:
led.value(0) # Turn off LED when button is not pressed