from machine import Pin, ADC
from machine import sleep_ms
from math import log
from machine import Pin
from neopixel import NeoPixel
from time import sleep_ms
S = ADC(Pin(33)atten = ADCATTNLIIB)
lido = S.read_u16()
#variavel 0 65535
t = convt(lido)
y=0
z=1
n = NeoPixel(Pin(23,Pin.OUT),16)
while True:
for x in range(y,16,2):
n[x]=(0,129,255)
for x in range(z,16,2):
n[x]=(255,64,64)
n.write()
sleep_ms(350)
if y == 0:
y = 1
z = 0
else:
y = 0
z = 1
def convT(valor):
negocio = log(1/(65535/valor-1))
bagulho = negocio/3950 + 1/298.15
temp = 1/bagulho - 273.15
return temp
Loading
esp32-devkit-c-v4
esp32-devkit-c-v4