#write a micropython script to control the brightness of the led connected to gpio14 with respect to the position of the potentiometer connected to gpio15
from machine import Pin, PWM, ADC
from time import sleep
frequency = 5000
led=PWM(Pin(14),frequency)
pot=ADC(Pin(15))
pot.width(ADC.WIDTH_10BIT) #11bit:2047 12bit:4095(default) only 4bit 9,10,11,12
pot.atten(ADC.ATTN_11DB)
while True:
pot_value = pot.read()
print("potentiometer value:", pot_value)
led.duty(pot_value)
sleep(0.1)