from machine import Pin
from time import sleep
led = Pin(10, Pin.OUT)
sw = Pin(21, Pin.IN)
while True:
if sw.value() == 1:
led.value(1)
print(led.value())
sleep(0.25)
else:
led.value(0)
print(led.value())
sleep(0.25)
from machine import Pin
from time import sleep
led = Pin(10, Pin.OUT)
sw = Pin(21, Pin.IN)
while True:
if sw.value() == 1:
led.value(1)
print(led.value())
sleep(0.25)
else:
led.value(0)
print(led.value())
sleep(0.25)