How to do a moving average in Arduino?
You would call: x = movingAverage(analogRead(DATA_PIN)); And the movingAverage function does the rest for you. Inside the movingAverage function, you'll see a const value that defines the number of values used in the average.
What is moving average in data analytics?
A moving average is a method for smoothing time series by averaging (with or without weights) a fixed number of consecutive terms. The averaging “moves” over time, in that each data point of the series is sequentially included in the averaging, while the oldest data point in the span of the average is removed.