import machine
import math
import utime
BETA = 3950
R1 = 10000
V_REF = 3.3
adc= machine.ADC(machine.Pin(28))
while True:
analog_value = adc.read_u16()
print( analog_value)
voltage = (analog_value / 65535) *V_REF
print(voltage)
resistance = R1 / ((V_REF / voltage) -1)
kelvin =1 / (1/ 298.15 + 1/ BETA * math.log(resistance / 10000))
celsius = kelvin -273.15
print("Temperature: {:.2f} °C" .format(celsius))
utime.sleep(1)