Allow pins/settings to be defined in INI file (#597)

* Allow pins/settings to be defined in INI file

* Open to make publishing ManufacturerData optional
This commit is contained in:
Jonathan authored and GitHub committed 2020-05-03 08:56:40 -05:00
1 parent 470790b42e
commit 9fc5ba99f5
9 files changed
+90 -56

No files matched your search

+11 -3
View File
@@ -31,10 +31,18 @@ extern void ADCtoMQTT();
/*----------------------------USER PARAMETERS-----------------------------*/
/*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/
#define ADCTOPIC "/ADCtoMQTT"
#define TimeBetweenReadingADC 500 // time between 2 ADC readings, minimum 200 to let the time of the ESP to keep the connection
#define ThresholdReadingADC 50 // following the comparison between the previous value and the current one +- the threshold the value will be published or not
#if !defined(TimeBetweenReadingADC) || (TimeBetweenReadingADC < 200)
#define TimeBetweenReadingADC 500 // time between 2 ADC readings, minimum 200 to let the time of the ESP to keep the connection
#endif
#ifndef ThresholdReadingADC
#define ThresholdReadingADC 50 // following the comparison between the previous value and the current one +- the threshold the value will be published or not
#endif
/*-------------------PIN DEFINITIONS----------------------*/
#define ADC_PIN A0 //on nodeMCU this is D3 GPIO0
#if defined(ESP8266) || !defined(ADC_PIN)
#define ADC_PIN A0 //on nodeMCU this is D3 GPIO0
#endif
#endif