import machine
from machine import Pin
import time
boton = machine.Pin(1, Pin.IN, Pin.PULL_DOWN)
ledRojo = Pin(0, Pin.OUT)
while True:
if boton.value() == 0:
ledRojo.value(0)
time.sleep(0.5)
elif boton.value() ==1:
ledRojo.value(1)
time.sleep(0.5)