#include "DHT.h"
#define DHTPIN 2
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
dht.begin();
}
void loop() {
// put your main code here, to run repeatedly:
float T = dht.readTemperature();
if(isnan(T)){
Serial.println("Failad to read from DHT sensor");
return;
}
Serial.print("Temperatuer: ");
Serial.print(T );
Serial.println(" *C");
delay(1000);
}