modm API documentation
|
#include <modm/math/filter/ramp.hpp>
Public Member Functions | |
Ramp (const T &increment, const T &decrement, const T &initialValue=T ()) | |
Create a ramp generator. More... | |
void | setTarget (const T &target) |
void | update () |
Calculate the next step. | |
void | reset (const T &value=T ()) |
const T & | getValue () const |
bool | isTargetReached () const |
Ramp.
The output value is incremented or decremented at every call to update until target has been reached by increment or decrement.
The final value is always set to target after several calls to update.
Example:
modm::filter::Ramp< T >::Ramp | ( | const T & | increment, |
const T & | decrement, | ||
const T & | initialValue = T () |
||
) |
Create a ramp generator.
increment | Step size for positive direction |
decrement | Step size for the negative direction. Needs to be positive! |
initialValue | Starting value |