'''from machine import Pin
import utime import sleep_ms
import time

led = Pin(21, Pin.OUT)

while True:

    led.value(0)
    time.sleep(2)
    #sleep_ms(2000)
    led.value(1)
    time.sleep(2)
    #sleep_ms(2000)
'''
from machine import Pin, PWM
import time

frecuencia = 5000
led = PWM(Pin(21, frecuencia))

while True:
    for i in range (0,1023):
        led.duty(i)
        time.sleep(0.005)
        print (i)
    for j in range (1023,-1,-1):
        led.duty(j)
        time.sleep(0.005)
        print (j)