from machine import Pin,ADC
from gpiolcd import GpioLcd
import time
adc1=machine.ADC(28)
conversion_factor=3.3/(65536)
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))
lcd.move_to(0,0)
lcd.putstr("TEMPERATURE")
lcd.move_to(0,1)
lcd.putstr("TEMPERATURE:")
while True:
val=adc1.read_u16()
temp=(val*conversion_factor)*100
temp1=int(temp)
lcd.move_to(13,1)
lcd.putstr(str(temp1))
time.sleep(1)