from machine import Pin
import time
# LED
led = Pin(0, Pin.OUT)
# Botones
boton_on = Pin(1, Pin.IN, Pin.PULL_UP)
boton_off = Pin(2, Pin.IN, Pin.PULL_UP)
while True:
# Botón 1 presionado (enciende LED)
if boton_on.value() == 0:
led.value(1)
# Botón 2 presionado (apaga LED)
if boton_off.value() == 0:
led.value(0)
time.sleep(0.1)