from machine import Pin,PWM
from time import sleep
servo=PWM(Pin(19),freq=50)
lista=[25,50,75,100,125,100,75,50]
push = Pin(14,Pin.IN,Pin.PULL_UP)
n=i=0
while(1):
# DETECCION
if push.value()==0:
sleep(0.03)
n = n+1
if n>2:
n=0
while(push.value()==0):
sleep(0.001)
# OPCIONES
if n==0:
t=0.8
elif n==1:
t=0.5
else:
t=0.2
servo.duty(lista[i])
sleep(t)
i = i+1
if i>7:
i=0