from machine import Pin,PWM,ADC
#from machine import Pin,ADC
import time
pot = ADC(Pin(34))
pot.atten(ADC.ATTN_6DB)
LED=Pin(14,Pin.OUT)
pwm=PWM(LED)
pwm.freq(500)
while True:
pot_value = pot.read()
pwmOut = int (pot_value/4)
pwm.duty(pwmOut)
print('Potentiometer Value = ',pot_value)
print('PWM Value = ',pwmOut)
time.sleep_ms(100)