from machine import Pin, ADC
from neopixel import NeoPixel
from math import log
from time import ticks_ms, ticks_add, ticks_diff, sleep
DT = const(500)
ntc = ADC(Pin(26))
tLe = ticks_ms()
pix = NeoPixel(Pin(21, Pin.OUT), 1)
pix[0] = (255, 255, 255)
pix.write()
while True:
if ticks_diff(ticks_ms(), tLe) >= DT:
v = ntc.read_u16()
t = 1/(log(1/(65535/v - 1))/3950 + 1.0/298.15) - 273.15
print(f"Valor: {v}")
tLe = ticks_add(ticks_ms(), DT)
sleep(0.2)