

#include "DHT.h"
#define DHTPIN 4
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
float _Temp, _Hum, _TempRess;
void setup(){
Serial.begin(9600);
delay(500);//Delay to let system boot
Serial.println("DHT11/22 Humidity & temperature Sensor\n\n");
pinMode (DHTPIN, INPUT_PULLUP);
delay(1000);//Wait before accessing Sensor
}
void loop(){
delay(1000);
_Temp = dht.readTemperature();
_Hum = dht.readHumidity();
_TempRess = dht.computeHeatIndex(_Temp, _Hum, false);
Serial.print(F("Hum: "));
Serial.print(_Hum);
Serial.print(F("% Temp: "));
Serial.print(_Temp);
Serial.print(F("°C "));
Serial.print(F(" Temp Ressentie: "));
Serial.print(_TempRess);
Serial.println(F("°C "));
}
dht11-complet.pdf