from machine import Pin, ADC, PWM
import utime

led = PWM(Pin(13))
pot = ADC(Pin(27))

led.freq(1000)

while True:
    pot_value = pot.read_u16()
    led.duty_u16(pot_value)
    utime.sleep(0.1)