modm API documentation
modm::filter::Ramp< T > Class Template Reference

Ramp. More...

#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
 

Detailed Description

template<typename T>
class modm::filter::Ramp< T >

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:

Constructor & Destructor Documentation

template<typename T >
modm::filter::Ramp< T >::Ramp ( const T &  increment,
const T &  decrement,
const T &  initialValue = T () 
)

Create a ramp generator.

Parameters
incrementStep size for positive direction
decrementStep size for the negative direction. Needs to be positive!
initialValueStarting value
Warning
Both values for increment and decrement needs to be positive!

The documentation for this class was generated from the following file: