import time
time.sleep(0.1) # Wait for USB to become ready
from machine import Pin
pulsador=Pin(2,Pin.IN)
led=Pin(1,Pin.OUT)
i=0
while True:
a=pulsador.value()
if a==1:
time.sleep(0.2)
if i==1:
i=0
led.on()
print(i)
elif i==0:
i=1
led.off()
print(i)