diff --git a/ZsensorDHT.ino b/ZsensorDHT.ino index c401951..d699bbc 100644 --- a/ZsensorDHT.ino +++ b/ZsensorDHT.ino @@ -31,7 +31,7 @@ #include #include -DHT dht(DHT_RECEIVER_PIN,DHT22); +DHT dht(DHT_RECEIVER_PIN,DHT_SENSOR_TYPE); //Time used to wait for an interval before resending temp and hum unsigned long timedht = 0; diff --git a/config_DHT.h b/config_DHT.h index a177c10..36edf7a 100644 --- a/config_DHT.h +++ b/config_DHT.h @@ -30,6 +30,10 @@ #define TEMP1 "home/DHTtoMQTT/dht1/temp" #define dht_always true // if false when the current value for temp or hum is the same as previous one don't send it by MQTT #define TimeBetweenReadingDHT 30000 // time between 2 DHT readings +/*-------------DHT SENSOR TYPE-------------*/ +//#define DHT_SENSOR_TYPE DHT11 //uncomment for DHT11 Sensor +//#define DHT_SENSOR_TYPE DHT21 //uncomment for DHT21 Sensor +#define DHT_SENSOR_TYPE DHT22 //uncomment for DHT22 Sensor (default for backwards compatibility) /*-------------------PIN DEFINITIONS----------------------*/ #if defined(ESP8266) || defined(ESP32) #define DHT_RECEIVER_PIN D1 // you can put D5 if you don't use HCSR501 sensor and the RFM69