from machine import Pin,ADC,PWM

led=PWM(Pin(25,Pin.OUT))

pot=ADC(Pin(34))

ADC.width(ADC.WIDTH_10BIT)

while 1:
  value=pot.read()
  print(value)  
  led.duty(value)