from picozero import Button
from utime import sleep, ticks_ms
entrada = Button(15,pull_up=True)
tiempoA = 0;
switch = False;
periodo = 0;
rpm = 0
while True:
t = ticks_ms()
if entrada.is_pressed and switch==False:
periodo = t-tiempoA
tiempoA = t
rpm = (1000/periodo)*60
print(rpm)
switch = True;
if entrada.is_pressed == False:
switch = False;
#sleep(0.1)