from machine import Pin, PWM
import time
#pines PWM para controlar los LEDs RGB
rojo = PWM(Pin(0),5000)
verde = PWM(Pin(1),5000)
azul = PWM(Pin(2),5000)
tiempo=0.01
# Bucle principal que se ejecuta indefinidamente
while True:
for pwm in range(0,65535,1000):
rojo.duty_u16(0)
verde.duty_u16(pwm)
azul.duty_u16(pwm)
time.sleep(tiempo)
for pwm in range(0,65535,1000):
rojo.duty_u16(0)
verde.duty_u16(pwm)
azul.duty_u16(0)
time.sleep(tiempo)
for pwm in range(0,65535,1000):
rojo.duty_u16(0)
verde.duty_u16(0)
azul.duty_u16(pwm)
time.sleep(tiempo)