import time
from machine import Pin,PWM,SoftI2C,ADC
from pico_i2c_lcd import I2cLcd
time.sleep(0.1) # Wait for USB to become ready
pot = ADC(26)
led = PWM(Pin(0))
i2c = SoftI2C(sda=Pin(16),scl=Pin(17),freq=400000)
lcd = I2cLcd(i2c,i2c.scan()[0],2,16)
led.freq(1000)
while True:
x = pot.read_u16()
print(x)
lcd.clear()
lcd.putstr(str(x))
led.duty_u16(x)
time.sleep(1)
# load.freq(1000)
# load.duty_u16(32767)
# led = Pin(0,Pin.OUT)
# led.on()
# time.sleep()
# led.off()
# time.sleep()