Store successive values in a circular (ring) buffer.
This is like an array of limited size, say 10 entries, into which you store values as you receive them. Once the buffer fills up (reaches 10 entries), as you add each new entry, the oldest entry is removed. You can easily implement this with a standard array, and an index which resets to zero every time it reaches the end of the array.
Then, rather than use the jittery output values directly, you push them into the circular buffer, and use the buffer's average value. I called this a running average, but if the average is over a sliding window of data (as with the ring buffer), then it's a moving average....a very simple way to smooth out jittery data a bit.
https://en.wikipedia.org/wiki/Moving_average
This is like an array of limited size, say 10 entries, into which you store values as you receive them. Once the buffer fills up (reaches 10 entries), as you add each new entry, the oldest entry is removed. You can easily implement this with a standard array, and an index which resets to zero every time it reaches the end of the array.
Then, rather than use the jittery output values directly, you push them into the circular buffer, and use the buffer's average value. I called this a running average, but if the average is over a sliding window of data (as with the ring buffer), then it's a moving average....a very simple way to smooth out jittery data a bit.
https://en.wikipedia.org/wiki/Moving_average