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-1500-2000) with trim adjustment.More...

  • #include <evaJoystick.h>

Inherits the following classes: TReader

Public Functions

Type Name
Joystick (short aDeadZone=0, Args... args)
Constructs a Joystick with optional dead zone.
void addTrim (short trimIncrement)
adds trim adjustment value
signed short getDeadZone ()
Gets current dead-zone value.
signed short getTrim ()
Gets current trim value.
signed short getValue ()
Gets normalized joystick position with custom ranges.
signed short getValue ()
Gets normalized joystick position (1000 to 2000).
void setDeadZone (short 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

Constructs a Joystick with optional dead zone.

template<typename... Args>
inline eva::Joystick::Joystick (
    short aDeadZone=0,
    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 signed short 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.

template<unsigned short MINPOS, unsigned short MIDDLEPOS, unsigned short MAXPOS>
inline signed short eva::Joystick::getValue () 

Template parameters:

  • MINPOS Minimum analog value
  • MIDDLEPOS Center analog value
  • MAXPOS Maximum analog value

Returns:

Value from 1000 to 2000


function getValue [2/2]

Gets normalized joystick position (1000 to 2000).

inline signed short eva::Joystick::getValue () 

Returns:

Value from 1000 to 2000


function setDeadZone

Sets dead-zone value.

inline void eva::Joystick::setDeadZone (
    short 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