# este programa esta diseñado por Miguel Cordoba y se activa la resistencia PUll UP
from machine import Pin
import time
# creando los objetos
interruptor = Pin(32, Pin.IN, Pin.PULL_UP)
ledInterno = Pin(2, Pin.OUT)
while True:
medicion = interruptor.value()
print(medicion)
time.sleep_ms(1000) # ✅ correcto
if medicion == 0:
ledInterno.value(1)
print("se encendio el led")
else:
ledInterno.value(0)
print("esta apagado el led")