From 93b1405b3e8388c622a6859abeccd43b493a0dc0 Mon Sep 17 00:00:00 2001 From: 1technophile Date: Fri, 24 Nov 2017 23:11:44 +0100 Subject: [PATCH] increase space for wifi stack #112 --- ZsensorADC.ino | 4 +++- config_ADC.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ZsensorADC.ino b/ZsensorADC.ino index 2480e6d..4fd133e 100644 --- a/ZsensorADC.ino +++ b/ZsensorADC.ino @@ -40,7 +40,9 @@ void MeasureADC(){ timeadc = millis(); static int persistedadc; int val = analogRead(ADC_PIN); - + #ifdef ESP8266 + yield(); + #endif if (isnan(val)) { trc(F("Failed to read from ADC !")); }else{ diff --git a/config_ADC.h b/config_ADC.h index d165d59..bf641b5 100644 --- a/config_ADC.h +++ b/config_ADC.h @@ -27,7 +27,7 @@ /*----------------------------USER PARAMETERS-----------------------------*/ /*-------------DEFINE YOUR MQTT PARAMETERS BELOW----------------*/ #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 /*-------------------PIN DEFINITIONS----------------------*/