from machine import PWM, Pin, ADC
from time import sleep
pinLED = 4
pinPot = 28
myLED = PWM(Pin(pinLED))
myPot = ADC(pinPot)
myLED.freq(1000)
myLED.duty_u16(0)
while True:
potValue = myPot.read_u16()
myLED.duty_u16(int(potValue))
sleep (0.1)