Closed rictolcrow closed 3 years ago
https://github.com/floodsense/floodsense_sensor/blob/0db0efaf8eafbbec5f2b7618c8418ed5ae939a7c/src/maxbotix.cpp#L73
The first reading in loop is always in error making the mean functions useless. No effect on median and mode.
Suggested fix is to flip lines 74 and 75 and possibly lines 70 and 71. I tried it and it fixes the bug
ac3409e0aa656bf015f5f783dcf4253ea90fa8b5 first reading bug is fixed by adding an extra read. Bug is due to the 'R's in the startup serial output; "MAXBOTIX CORPORATION INC"
https://github.com/floodsense/floodsense_sensor/blob/0db0efaf8eafbbec5f2b7618c8418ed5ae939a7c/src/maxbotix.cpp#L73
The first reading in loop is always in error making the mean functions useless. No effect on median and mode.
Suggested fix is to flip lines 74 and 75 and possibly lines 70 and 71. I tried it and it fixes the bug