I am writing some firmware for a display that will take measurements and present them in real time on an LCD screen. I would like for the measurements to display as smoothly as possible... What I mean is that I am looking for a smooth animation sequence on the display, such that values don't jump from say 15.1 to 15.8... I'd like for the reading to look more natural, where maybe a sequence of values would be displayed as the value increased from 15.1 to 15.4, something like:
- 15.1
- 15.2
- 15.3
- 15.4
Before going and re-inventing the wheel, is there an algorithm that already describes what is going on here? I guess I would feel comfortable with treating these numbers as strings since that's how they will ultimately be sent to the display (as ASCII characters). Or it doesn't matter if they're treated as floating point numbers, because I can just convert them into strings before I send them to the display.
Also I'd like to add that for cases like 0.0625 to 0.1350... that the algorithm not count every single case in between the two numbers, pick maybe just 10 numbers between the two and display them.
Is there any algorithm that describes this process for the multiple cases as described above?