from machine import Pin, PWM
from time import sleep
led = PWM(Pin(2)) # configurar GPI032 como salida PWM
led.freq(5) # Frecuencia de 500 Hz
while True:
for duty in range(0, 1024, 100): # Incrementar el duty cycle
led.duty(duty)
sleep(0.5)