Added gitignore file. Added sensor selection to DHT config for DHT11/… (#152)
* Added gitignore file. Added sensor selection to DHT config for DHT11/21/22 sensors. DHT22 used a default to ensure backwards compatibility. * Removed quotes to fix compliation error. * Moved local ignored file from .gitignore to .git/info/exclude per request. Removed .gitignore.
This commit is contained in:
1 parent
0a1f2b1cdb
commit
9d55af871b
2 files changed
+5
-1
No files matched your search
+1
-1
@@ -31,7 +31,7 @@
|
|||||||
#include <DHT.h>
|
#include <DHT.h>
|
||||||
#include <DHT_U.h>
|
#include <DHT_U.h>
|
||||||
|
|
||||||
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
|
//Time used to wait for an interval before resending temp and hum
|
||||||
unsigned long timedht = 0;
|
unsigned long timedht = 0;
|
||||||
|
|||||||
@@ -30,6 +30,10 @@
|
|||||||
#define TEMP1 "home/DHTtoMQTT/dht1/temp"
|
#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 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
|
#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----------------------*/
|
/*-------------------PIN DEFINITIONS----------------------*/
|
||||||
#if defined(ESP8266) || defined(ESP32)
|
#if defined(ESP8266) || defined(ESP32)
|
||||||
#define DHT_RECEIVER_PIN D1 // you can put D5 if you don't use HCSR501 sensor and the RFM69
|
#define DHT_RECEIVER_PIN D1 // you can put D5 if you don't use HCSR501 sensor and the RFM69
|
||||||
|
|||||||
Reference in new issue
Block a user