from machine import Pin,ADC
from utime import sleep
from math import log
import tm1637
tm = tm1637.TM1637(clk=Pin(0), dio=Pin(1))
BETA = 3950
sleep(0.01)
ntc=ADC(Pin(26))
while 1:
val=ntc.read_u16()
temp=1 / (log(1 / (65535. / val - 1)) / BETA + 1.0 / 298.15) - 273.15;
print(temp)
tm.temperature(int(temp))
sleep(0.3)