from machine import Pin, PWM
from time import sleep
R = PWM(Pin(23),freq=50)
G = PWM(Pin(22),freq=50)
B = PWM(Pin(21),freq=50)
push = Pin(14,Pin.IN,Pin.PULL_UP)
def tiempo (x):
R.duty(int(x))
G.duty(int(x))
B.duty(int(x))
lista = ["0","300","600","900","1023"]
n=0
while(1):
if push.value()==0:
tiempo(lista[n])
n=n+1
if n>4:
n=0
sleep(0.3)
while push.value()==0:
sleep(0.2)