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 * 1823)
led.duty(duty)
print(f"Lectura del potenciómetro: {lectura}, duty (valor pwm): {duty}")
time.sleep(0.5)