Simple Moving Average summation/offset issue
问题 I wrote a simple moving average with a moving window of Temperatures read as a voltage between 0 and 10V. The algorithm appears to work correctly, however, it has a problem where depending upon which Temperatures filled the window first, the moving average will have an offset for any values not near this value. For example, running this program with the temp. sensor plugged in a room temp yields 4.4V or 21.3 C. Though, if I unplug the temp. sensor the voltage drops to 1.4V yet the moving