from machine import Pin, PWM
from time import sleep
pwm = PWM(Pin(15))
pwm.freq(10)
while True:
for duty in range(65025): #En realidad seria 6535 el valor mas alto de un "ADC"
pwm.duty_u16(duty)
sleep(0.000001)
for duty in range(65025, 0, -1):
pwm.duty_u16(duty)
sleep(0.000001)