import time
from machine import Pin, I2C, ADC
from lcd_api import LcdApi
from pico_i2c_lcd import I2cLcd
time.sleep(0.1)
I2C_ADDR = 0x27
I2C_NUM_ROWS = 4
I2C_NUM_COLS = 20
i2c = I2C(0, sda=machine.Pin(20), scl=machine.Pin(21), freq=400000)
lcd = I2cLcd(i2c, 0x27, 4, 20)
pot = ADC(26)
while True:
i = pot.read_u16()
n = i/65535*300
lcd.putstr(str(n)+"degree")
time.sleep(2)
lcd.clear()
time.sleep(0.2)