import time
time.sleep(0.1) # Wait for USB to become ready
print("Hello, Pi Pico!")
from machine import Pin,ADC
from math import log
import lcdi2c as lcd
BETA = 3950
ntc=ADC(Pin(28))
while 1:
analogValue = ntc.read_u16()
celsius = 1 / (log(1 / (65535. / analogValue - 1)) / BETA + 1.0 / 298.15) - 273.15
print("Tem:",celsius,"^C")
lcd.cmd_write(0xc0)
lcd.cmd_write(0x0c)
if celsius < 30:
lcd.str_write("Tem: "+str(round(celsius,2))+" Cold ")
else:
lcd.str_write("Tem: "+str(round(celsius,2))+" Hot ")
time.sleep(0.5)