import utime
from machine import Pin, PWM
# Construct PWM object, with LED on Pin(18).
pwm_r = PWM(Pin(18))
pwm_g = PWM(Pin(20))
pwm_b = PWM(Pin(19))
# Set the PWM frequency.
pwm_r.freq(1000)
pwm_g.freq(1000)
pwm_b.freq(1000)
# Fade the LED in and out a few times.
def trimming(r,g,b):
pwm_r.duty_u16(65535 * r //100 )
pwm_g.duty_u16(65532 * g //100 )
pwm_b.duty_u16(65535 * b //100)
trimming(100,50,0)