from machine import Pin
import time
sw1_1 = Pin(8, Pin.IN)
led_verde = Pin(0, Pin.OUT)
while True:
if sw1_1.value() == 1:
led_verde.value(1)
print("Interruptor cerrado, '1'")
print("LED VERDE en GPIO0 encendido")
time.sleep(0.5)
else:
led_verde.value(0)
print("Interruptor abierto, '0'")
print("LED VERDE en GPIO0 apagado")
time.sleep(0.5)