#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN,DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println("DHTxx test");
dht.begin();
// put your setup code here, to run once:
}
void loop() {
delay(6000);
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);
if(isnan(h) || isnan(t) || isnan(f)){
Serial.println(F("Failed to read fron DHT Sensor!"));
return;
}
Serial.print(F("Humidity: "));
Serial.println(h);
Serial.print(F("%Temperature: "));
Serial.println(t);
Serial.println(F("C"));
}