template<typename T = uint8_t>
class modm::ui::FastRamp< T >
This class allows the linear ramping of one value over a number of steps.
All integer types use binary scaling through a fixed-point arithmetic, however, all other types default to floating-point arithmetic with casting between types.
Be aware that the algortihm for 8bit types is optimized for low computational costs. Therefore the steps are limited to 128 steps * value_difference
, which is 32'768 steps over the full 8bit range. If you specify a more steps in this case, the ramp simply is 'steeper'. If this is a problem, consider using a 16bit type, which does not have this limitation.
- Warning
- This class does not know when to stop stepping. This means, that over- and underflows of the target value must be prevented externally.
- Author
- Niklas Hauser