tatobari / hx711py

HX711 Python Library for Raspberry Pi.
Apache License 2.0
206 stars 154 forks source link

Fix median calculation for even number of samples #47

Open christosvar opened 2 years ago

christosvar commented 2 years ago

If valueList has 2*N points, then midpoint will be equal to N, and points N-1 and N should be considered for the average, not N and N+1 (considering zero-based indexing).