import machine
import time
# Create PWM object on GPIO pin 17 (connected to the LED)
led_pwm = machine.PWM(machine.Pin(17))
# Set PWM frequency (in Hz)
led_pwm.freq(5000)
# Loop to control LED brightness
while True:
for duty_cycle in range(0, 4024, 64):
led_pwm.duty_u16(duty_cycle)
time.sleep(0.1)