from machine import Pin
from gpio_lcd import GpioLcd
import time
import utime
conversion_factor = 3.3/(65536)
adc2 = machine.ADC(27)
lcd = GpioLcd(rs_pin = Pin(8),
enable_pin = Pin(9),
d4_pin = Pin(10),
d5_pin = Pin(11),
d6_pin = Pin(12),
d7_pin = Pin(13))
while True:
val2 = adc2.read_u16()
temp = (val2 * conversion_factor)*100
temp1 = int(temp)
temp2 = str(temp1)
print("====================")
print("temperature: ",temp1)
lcd.move_to(0,0)
lcd.putstr('TEMP in Degree :')
lcd.move_to(0,1)
lcd.putstr(temp2)
time.sleep(0.8)
lcd.clear()