#include <DHT.h>
int p=13;
DHT dht(p, DHT22);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("DHT22 Example!!");
dht.begin();
}
void loop() {
// put your main code here, to run repeatedly:
float tempareture = dht.readTemperature();
float humidity = dht.readHumidity();
if(isnan(tempareture) || isnan(humidity)){
Serial.println("Failed to read DHT Sensor..");
return;
}
Serial.print("Humiditity : ");
Serial.print(humidity);
Serial.print("% Tempareture : ");
Serial.print(tempareture);
Serial.print("°C");
Serial.println();
delay(1000);
}