from machine import Pin
led = Pin(2, Pin.OUT)
btn = Pin(33, Pin.IN)
while True:
if btn.value() == 0:
led.off()
print("LED IS OFF")
else:
led.on()
print("LED IS ON")
from machine import Pin
led = Pin(2, Pin.OUT)
btn = Pin(33, Pin.IN)
while True:
if btn.value() == 0:
led.off()
print("LED IS OFF")
else:
led.on()
print("LED IS ON")