from dht import DHT22
from machine import Pin
from time import sleep_ms,localtime
sen = DHT22(Pin(26))
while True:
sen.measure()
temp = sen.temperature()
hum = sen.humidity()
t = localtime()
agora = f'{t[0]}-{t[1]}-{t[2]} T {t[3]}:{t[4]}:{t[5]}'
print(temp)
print(hum)
arq = open( 'dados2.csv' , 'a')
arq.write(f'{agora} ; (temp);(uni)\n')
arq.close()
sleep_ms(2000)Loading
esp32-devkit-c-v4
esp32-devkit-c-v4