Skip to content

Class eva::Joystick

template <class TReader, unsigned short tMinPos, unsigned short tMiddlePos, unsigned short tMaxPos>

ClassList > eva > Joystick

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 (unsigned short aMinPos, unsigned short aMiddlePos, unsigned 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:

  • deadZone dead-zone value

Template parameters:

  • TReader Underlying reader type
  • tMinPos Minimum analog value
  • tMiddlePos Center value
  • tMaxPos Maximum 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:

  • aDeadZone Dead-zone value (0-255)
  • args Additional arguments passed to TReader constructor

function addTrim

adds trim adjustment value

inline void eva::Joystick::addTrim (
    short trimIncrement
) 

Parameters:

  • trim value

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 (
    unsigned short aMinPos,
    unsigned short aMiddlePos,
    unsigned short aMaxPos
) 

Parameters:

  • aMinPos Minimum analog value
  • aMiddlePos Center analog value
  • aMaxPos Maximum 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:

  • deadZone dead-zone value

function setTrim

Sets trim adjustment value.

inline void eva::Joystick::setTrim (
    short trim
) 

Parameters:

  • trim Trim value


The documentation for this class was generated from the following file src/evaJoystick.h