From d2e710b4ba92d94e8aa4ea473a378eea8eb62802 Mon Sep 17 00:00:00 2001 From: Fisch Date: Mon, 8 Mar 2021 19:36:14 +0100 Subject: [PATCH] change filter value --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8e9a54b..41f1104 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -61,7 +61,7 @@ float spread=0; #define READING_FILTER_SIZE 40 //latency is about READING_FILTER_SIZE/2*MEASURE_INTERVAL float weight_read[READING_FILTER_SIZE] = {0}; uint8_t weight_read_pos=0; -#define MEANVALUECOUNT 4 //0<= meanvaluecount < READING_FILTER_SIZE/2 +#define MEANVALUECOUNT 5 //0<= meanvaluecount < READING_FILTER_SIZE/2. how many values will be used from sorted weight array from the center region. abour double this values reading are used float weight_tare=0; //minimal filtered weight #define MIN_WEIGHT_DIFFERENCE 50 //minimum weight @@ -184,7 +184,7 @@ void loopHandler() { Serial.print("new tare="); Serial.println(weight_tare,3); last_display_blink=loopmillis; //blink } - + if (weight_filtered>weight_max) { //new max weight_max=weight_filtered; update_display=true;