From 9daa1c867a6b4971c73352a3f087a5603f54cb85 Mon Sep 17 00:00:00 2001 From: Fisch Date: Sat, 22 Apr 2023 15:19:12 +0200 Subject: [PATCH] set array size to a working value --- src/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index d4e33bc..3452122 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -104,7 +104,7 @@ unsigned long time_adcwait=1000/spsadc; int adc_readings=1; //ca. 700ms for 5 readings, ca 75ms for 1 reading, readings=1 10times = 747ms double weight=0; -#define ADCMEDIANVALUES_MAX 93 //needs to be uneven, maximum number, for array declaration +#define ADCMEDIANVALUES_MAX 91 //needs to be uneven, maximum number, for array declaration float weightseries[ADCMEDIANVALUES_MAX]; //last n values for median filter uint16_t adcmedianvalues=DEFAULT_ADCMEDIANVALUES; //needs to be uneven //eeprom float adcFilterKeepMedianvaluesFactor=0.8; //how many lowest and highest values will be removed from the array before avaraging (as factor). 0.0 means only median is used. 1.0 means all values are used. @@ -999,7 +999,7 @@ float getWeightSeriesMax() } String toWeightString(double w){ - return toWeightString(w,2,6); + return toWeightString(w,3,6); } String toWeightString(double w,uint8_t dec,uint8_t len){ char outstring[16];