import machine
import time
# ESP32 Pin assignment
LED1_pin= 22
boton_encendido_pin= 18
boton_apagado_pin=19
estado_LED=0
boton_encendido= machine.Pin(boton_encendido_pin, machine.Pin.IN, machine.Pin.PULL_UP)
boton_apagado= machine.Pin(boton_apagado_pin, machine.Pin.IN, machine.Pin.PULL_UP)
LED1=machine.Pin(LED1_pin, machine.Pin.OUT)
print(" ")
print(" ")
print("-----Programa iniciado-----")
while True:
if boton_encendido.value()==0:
if estado_LED==0:
LED1.on()
estado_LED=1
else:
pass
if boton_apagado.value()==0:
if estado_LED==1:
LED1.off()
estado_LED=0
else:
pass