VEX V5 C++ API
Public Member Functions | List of all members
vex::controller::axis Class Reference

Use the axis class to get values from one of the controller's joysticks. More...

Public Member Functions

 axis ()
 
 axis (const tAxisType id, controller *parent)
 
 ~axis ()
 
int32_t value (void)
 Gets the value of the joystick axis on a scale from -127 to 127. More...
 
int32_t position (percentUnits units=percentUnits::pct)
 Gets the position of the joystick axis on a scale from -100 to 100. More...
 

Detailed Description

Use the axis class to get values from one of the controller's joysticks.

Constructor & Destructor Documentation

◆ axis() [1/2]

vex::controller::axis::axis ( )
inline

◆ axis() [2/2]

vex::controller::axis::axis ( const tAxisType  id,
controller parent 
)
inline

◆ ~axis()

vex::controller::axis::~axis ( )
inline

Member Function Documentation

◆ value()

int32_t vex::controller::axis::value ( void  )

Gets the value of the joystick axis on a scale from -127 to 127.

Returns
Returns an integer that represents the value of the joystick axis.

◆ position()

int32_t vex::controller::axis::position ( percentUnits  units = percentUnits::pct)

Gets the position of the joystick axis on a scale from -100 to 100.

Returns
Returns an integer that represents the position of the joystick axis as defined by the unit in the parameter.
Parameters
units(Optional) The type of unit that will be returned. By default, this parameter is a percentage.