from machine import Pin
from utime import sleep
LED= Pin(4, Pin.OUT)
BUTTON = Pin(2, Pin.IN)
while True:
if BUTTON.value() ==0:
LED.on()
sleep(0.1)
else:
LED.off()from machine import Pin
from utime import sleep
LED= Pin(4, Pin.OUT)
BUTTON = Pin(2, Pin.IN)
while True:
if BUTTON.value() ==0:
LED.on()
sleep(0.1)
else:
LED.off()