moves some parameters to config files
This commit is contained in:
1 parent
06d3e2eb41
commit
17a7294c94
4 files changed
+9
-9
No files matched your search
@@ -34,7 +34,6 @@ Thanks to wolass https://github.com/wolass for suggesting me HM 10 and dinosd ht
|
||||
#define RESPONSE_MSG "OK+DISIS"
|
||||
#define RESP_END_MSG "OK+DISCE"
|
||||
#define SETUP_MSG "OK+RESET"
|
||||
#define TimeBtw_Read 10000
|
||||
|
||||
SoftwareSerial softserial(BT_RX, BT_TX);
|
||||
|
||||
|
||||
+2
-8
@@ -30,20 +30,14 @@
|
||||
#ifdef ZsensorDHT
|
||||
#include <DHT.h>
|
||||
#include <DHT_U.h>
|
||||
#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 TimeBetweenReading 30000
|
||||
DHT dht(DHT_RECEIVER_PIN,DHT22); // Defined in User_config.h
|
||||
|
||||
/*----------------------------USER PARAMETERS-----------------------------*/
|
||||
/*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/
|
||||
#define HUM1 "home/DHTtoMQTT/dht1/hum"
|
||||
#define TEMP1 "home/DHTtoMQTT/dht1/temp"
|
||||
DHT dht(DHT_RECEIVER_PIN,DHT22);
|
||||
|
||||
//Time used to wait for an interval before resending temp and hum
|
||||
unsigned long timedht = 0;
|
||||
|
||||
void MeasureTempAndHum(){
|
||||
if (millis() > (timedht + TimeBetweenReading)) {//retriving value of temperature and humidity of the box from DHT every xUL
|
||||
if (millis() > (timedht + TimeBetweenReadingDHT)) {//retriving value of temperature and humidity of the box from DHT every xUL
|
||||
timedht = millis();
|
||||
static float persistedh;
|
||||
static float persistedt;
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
*/
|
||||
/*----------------------BT topics & parameters-------------------------*/
|
||||
#define subjectBTtoMQTT "home/BTtoMQTT/"
|
||||
#define TimeBtw_Read 10000 //define the time between 2 scans
|
||||
#define HM-10
|
||||
//#define HM-11 // uncomment this line if you use HM-11 and comment the line above
|
||||
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*----------------------------USER PARAMETERS-----------------------------*/
|
||||
/*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/
|
||||
#define HUM1 "home/DHTtoMQTT/dht1/hum"
|
||||
#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
|
||||
/*-------------------PIN DEFINITIONS----------------------*/
|
||||
#ifdef I2C_Wiring // With Support for I2C Modules
|
||||
#define DHT_RECEIVER_PIN 14 //on nodeMCU this is D5 GPIO14
|
||||
|
||||
Reference in new issue
Block a user