from machine import Pin,ADC,PWM
from time import sleep
pot_pin=28
red_led=15
my_pot=ADC(pot_pin)
led=PWM(Pin(red_led))
led.freq(1000)
led.duty_u16(0)
while True:
pot_value=my_pot.read_u16()
exp_value=(16/65550)*pot_value
brillo=2**exp_value
print(pot_value,exp_value,brillo)
led.duty_u16(int(brillo))