1 parent
af5e4e8ec9
commit
93b1405b3e
2 files changed
+4
-2
No files matched your search
+3
-1
@@ -40,7 +40,9 @@ void MeasureADC(){
|
|||||||
timeadc = millis();
|
timeadc = millis();
|
||||||
static int persistedadc;
|
static int persistedadc;
|
||||||
int val = analogRead(ADC_PIN);
|
int val = analogRead(ADC_PIN);
|
||||||
|
#ifdef ESP8266
|
||||||
|
yield();
|
||||||
|
#endif
|
||||||
if (isnan(val)) {
|
if (isnan(val)) {
|
||||||
trc(F("Failed to read from ADC !"));
|
trc(F("Failed to read from ADC !"));
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
+1
-1
@@ -27,7 +27,7 @@
|
|||||||
/*----------------------------USER PARAMETERS-----------------------------*/
|
/*----------------------------USER PARAMETERS-----------------------------*/
|
||||||
/*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/
|
/*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/
|
||||||
#define ADC "home/ADCtoMQTT"
|
#define ADC "home/ADCtoMQTT"
|
||||||
#define TimeBetweenReadingADC 100 // time between 2 ADC readings, minimum 100 to let the time of the ESP to keep the connection
|
#define TimeBetweenReadingADC 200 // 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
|
#define ThresholdReadingADC 50 // following the comparison between the previous value and the current one +- the threshold the value will be published or not
|
||||||
|
|
||||||
/*-------------------PIN DEFINITIONS----------------------*/
|
/*-------------------PIN DEFINITIONS----------------------*/
|
||||||
|
|||||||
Reference in new issue
Block a user