#include <DHT.h>;
#define dht_pin A0
#define dht_type DHT22
DHT dht(dht_pin, dht_type);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dht.begin();
}
long lastTime = 0;
void loop() {
// put your main code here, to run repeatedly:
if (millis() > lastTime + 300*1000)
{
float t = dht.readTemperature();
Serial.print("Nhiệt độ: ");
Serial.println(t);
lastTime = millis();
}
}