import machine
from machine import Pin
import time
pulsador = Pin (2,Pin.IN,Pin.PULL_UP)
contador = 0
while True:
while pulsador.value():
continue
time.sleep_ms(3)
contador += 1
print("Contador= "+str(contador))
while not pulsador.value():
continue
time.sleep_ms(3)