from machine import Pin
import utime
interruptor = Pin(32, Pin.IN, Pin.PULL_UP)
ledInterno = Pin(2, Pin.OUT)
while True:
medicion = interruptor.value()
print(medicion)
utime.sleep_ms(1000)
if medicion == 0:
ledInterno.value(1)
print("Se encendio el led")
else:
ledInterno.value(0)
print("Esta apagado el led") Loading
esp32-devkit-c-v4
esp32-devkit-c-v4