from machine import ADC, Pin, PWM
import time

pot = ADC (Pin(34))
pot.atten(ADC.ATTN_11DB)
led = PWM(Pin(4), freq = 5000)

while True:
    lectura = pot.read();
    duty = int(lectura / 4095 * 1023)
    led.duty(duty)
print(f"Lectura del potenciometro: {lectura}\tduty (valor pwm): {duty}")
time.sleep(0.5)