Class eva::Joystick¶
template <class TReader, signed short tMinPos, signed short tMiddlePos, signed short tMaxPos>
Joystick axis reader (range -1000 .. 0 .. 1000) with trim adjustment.More...
#include <evaJoystick.h>
Inherits the following classes: TReader
Public Functions¶
| Type | Name |
|---|---|
| Joystick () Constructs a Joystick with zero dead zone. |
|
| Joystick (unsigned char aDeadZone, Args... args) Constructs a Joystick with optional dead zone. |
|
| void | addTrim (short trimIncrement) adds trim adjustment value |
| unsigned char | getDeadZone () Gets current dead-zone value. |
| signed short | getTrim () Gets current trim value. |
| signed short | getValue (signed short aMinPos, signed short aMiddlePos, signed short aMaxPos) Gets normalized joystick position with custom ranges. |
| signed short | getValue () Gets normalized joystick position (-1000 to 1000). |
| void | setDeadZone (unsigned char deadZone) Sets dead-zone value. |
| void | setTrim (short trim) Sets trim adjustment value. |
Detailed Description¶
Parameters:
deadZonedead-zone value
Template parameters:
TReaderUnderlying reader typetMinPosMinimum analog valuetMiddlePosCenter valuetMaxPosMaximum analog value
Public Functions Documentation¶
function Joystick [1/2]¶
Constructs a Joystick with zero dead zone.
inline eva::Joystick::Joystick ()
function Joystick [2/2]¶
Constructs a Joystick with optional dead zone.
template<typename... Args>
inline eva::Joystick::Joystick (
unsigned char aDeadZone,
Args... args
)
Parameters:
aDeadZoneDead-zone value (0-255)argsAdditional arguments passed to TReader constructor
function addTrim¶
adds trim adjustment value
inline void eva::Joystick::addTrim (
short trimIncrement
)
Parameters:
trimvalue
function getDeadZone¶
Gets current dead-zone value.
inline unsigned char eva::Joystick::getDeadZone ()
Returns:
deadZone value
function getTrim¶
Gets current trim value.
inline signed short eva::Joystick::getTrim ()
Returns:
trim value
function getValue [1/2]¶
Gets normalized joystick position with custom ranges.
inline signed short eva::Joystick::getValue (
signed short aMinPos,
signed short aMiddlePos,
signed short aMaxPos
)
Parameters:
aMinPosMinimum analog valueaMiddlePosCenter analog valueaMaxPosMaximum analog value
Returns:
Value from -1000 to 1000
function getValue [2/2]¶
Gets normalized joystick position (-1000 to 1000).
inline signed short eva::Joystick::getValue ()
Returns:
Value from -1000 to 1000
function setDeadZone¶
Sets dead-zone value.
inline void eva::Joystick::setDeadZone (
unsigned char deadZone
)
Parameters:
deadZonedead-zone value
function setTrim¶
Sets trim adjustment value.
inline void eva::Joystick::setTrim (
short trim
)
Parameters:
trimTrim value
The documentation for this class was generated from the following file src/evaJoystick.h