from machine import Pin
from time import sleep
BUTTON = Pin(1, Pin.IN)
led = Pin(11, Pin.OUT)
while True:
print(BUTTON.value())
if BUTTON.value() == 1:
led.on()
sleep(1)
else:
led.off()
sleep(1)
from machine import Pin
from time import sleep
BUTTON = Pin(1, Pin.IN)
led = Pin(11, Pin.OUT)
while True:
print(BUTTON.value())
if BUTTON.value() == 1:
led.on()
sleep(1)
else:
led.off()
sleep(1)