A sensor’s readings jump around. Keep a smoothed value that updates with every new reading. Write smooth(previous, reading, keep): the new smoothed value, where previous is the smoothed value so far and keep (0 to 1) is how much of it to hold on to.
| 21 | 25 | 19 | 23 | 20 | 24 |