from machine import Pin, PWM
import time
LED_BUITLTIN = 25 # For Raspberry Pi Pico
pwm_led = PWM(Pin(LED_BUITLTIN, mode=Pin.OUT)) # Attach PWM object on the LED pin
pwm_led.freq(1_000)
pwm_led1 = PWM(Pin(0, mode=Pin.OUT)) # Attach PWM object on the LED pin
pwm_led1.freq(1_000)
while True:
for duty in range(0,65_535,500): # Duty from 0 to 100 %
pwm_led.duty_u16(duty)
pwm_led1.duty_u16(duty)
time.sleep_ms(10)
print(duty)
for duty in range(65_535,0,-500): # Duty from 0 to 100 %
pwm_led.duty_u16(duty)
pwm_led1.duty_u16(duty)
time.sleep_ms(10)
print(duty)