import time
import machine
# Configuración de pines
button = machine.Pin(7, machine.Pin.IN, machine.Pin.PULL_UP)
led = machine.Pin(22, machine.Pin.OUT)
# Bucle principal
while True:
if button.value() == 0:
led.value(1)
time.sleep(0.5) # led encendido 0.5 segundos
led.value(0)
time.sleep(0.5) # led apagado 0.5 segundos
else:
led.value(0)