from machine import Pin
import time
led_pin = Pin(21, Pin.OUT)
switch_pin = Pin(14, Pin.IN)
while True:
switch_state = switch_pin.value()
if switch_state == 0:
led_pin.on()
print("LED ON")
else:
led_pin.off()
print("LED OFF")
time.sleep(0.5)