From e03fea6eb92510ef655d1acb34debb6f8f782ef1 Mon Sep 17 00:00:00 2001 From: Fisch Date: Thu, 16 May 2024 19:11:06 +0200 Subject: [PATCH] improve timing values --- include/ec.h | 4 ++-- include/flow.h | 4 ++-- include/waterlevel.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/ec.h b/include/ec.h index 59d7991..7b7f685 100644 --- a/include/ec.h +++ b/include/ec.h @@ -34,13 +34,13 @@ uint16_t ec_calib_array[EC_CALIB_ARRAY_SIZE]; uint16_t ec_calib_array_pos=0; #define EC_CALIB_READ_INTERVAL 250 //interval of reading adc value inside a measurement -#define EC_ARRAY_SIZE 256 +#define EC_ARRAY_SIZE 64 uint16_t ec_array[EC_ARRAY_SIZE]; uint16_t ec_array_pos=EC_ARRAY_SIZE; unsigned long last_measurement_ec=0; #define EC_MEASUREMENT_INTERVAL 10*60*1000 //complete filtered measurement every x ms //One filtered measurement takes EC_READ_INTERVAL*EC_ARRAY_SIZE*4 -#define EC_READ_INTERVAL 10 //interval of reading adc value inside a measurement. one reading takes about 9-10ms +#define EC_READ_INTERVAL 50 //interval of reading adc value inside a measurement. one reading takes about 9-10ms #define EC_RELAY_SWITCH_SETTLETIME 500 //time until voltage of ec circuit has settled diff --git a/include/flow.h b/include/flow.h index b79d1b4..83f7a50 100644 --- a/include/flow.h +++ b/include/flow.h @@ -26,12 +26,12 @@ void flow_setup() { timing_flow_a.minchange=0.0; timing_flow_a.maxchange=0.3; - timing_flow_a.mintime=10*000; + timing_flow_a.mintime=10*1000; timing_flow_a.maxtime=30*60*1000; timing_flow_b.minchange=0.0; timing_flow_b.maxchange=0.3; - timing_flow_b.mintime=10*000; + timing_flow_b.mintime=10*1000; timing_flow_b.maxtime=30*60*1000; pinMode(FLOW_A_PIN, INPUT_PULLUP); diff --git a/include/waterlevel.h b/include/waterlevel.h index ccb3d36..b67e921 100644 --- a/include/waterlevel.h +++ b/include/waterlevel.h @@ -171,12 +171,12 @@ void waterlevel_setup() { timing_waterlevelA.minchange=0.0; - timing_waterlevelA.maxchange=3.0; + timing_waterlevelA.maxchange=7.0; timing_waterlevelA.mintime=30*000; timing_waterlevelA.maxtime=60*60*1000; timing_waterlevelB.minchange=0.0; - timing_waterlevelB.maxchange=0.5; + timing_waterlevelB.maxchange=3.0; timing_waterlevelB.mintime=10*000; timing_waterlevelB.maxtime=60*60*1000;