diff --git a/esp32/include/ControllerConfiguration.h b/esp32/include/ControllerConfiguration.h index 85db895..ad2bb04 100644 --- a/esp32/include/ControllerConfiguration.h +++ b/esp32/include/ControllerConfiguration.h @@ -101,6 +101,7 @@ #define TEMPERATUR_TIMEOUT 3000 /**< 3 Seconds timeout for the temperatur sensors */ #define TEMP_SENSOR_MEASURE_SERIES 5 +#define VOLT_SENSOR_MEASURE_SERIES 5 /* @} */ #endif \ No newline at end of file diff --git a/esp32/src/main.cpp b/esp32/src/main.cpp index 21e2c22..261614b 100644 --- a/esp32/src/main.cpp +++ b/esp32/src/main.cpp @@ -85,8 +85,8 @@ int readCounter = 0; bool mConfigured = false; long nextBlink = 0; /**< Time needed in main loop to support expected blink code */ -RunningMedian lipoRawSensor = RunningMedian(5); -RunningMedian solarRawSensor = RunningMedian(5); +RunningMedian lipoRawSensor = RunningMedian(VOLT_SENSOR_MEASURE_SERIES); +RunningMedian solarRawSensor = RunningMedian(VOLT_SENSOR_MEASURE_SERIES); RunningMedian waterRawSensor = RunningMedian(5); RunningMedian lipoTempSensor = RunningMedian(TEMP_SENSOR_MEASURE_SERIES); RunningMedian waterTempSensor = RunningMedian(TEMP_SENSOR_MEASURE_SERIES); @@ -180,7 +180,7 @@ long getDistance() */ void readSystemSensors() { - for (int i = 0; i < 5; i++) + for (int i = 0; i < VOLT_SENSOR_MEASURE_SERIES; i++) { lipoRawSensor.add(analogRead(SENSOR_LIPO)); solarRawSensor.add(analogRead(SENSOR_SOLAR));