Use the axis class to get values from one of the controller's joysticks.
More...
#include <vex_controller.h>
|
| axis (const tAxisType id, controller *parent) |
|
void | changed (void(*callback)(void)) const |
| Sets the function to be called when the joystick axis value changes.
|
|
int32_t | value (void) const |
| Gets the value of the joystick axis on a scale from -127 to 127.
|
|
int32_t | position (percentUnits units=percentUnits::pct) const |
| Gets the position of the joystick axis on a scale from -100 to 100.
|
|
Use the axis class to get values from one of the controller's joysticks.
Definition at line 143 of file vex_controller.h.
◆ 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 |
◆ changed()
void vex::controller::axis::changed |
( |
void(* | callback )(void) | ) |
const |
Sets the function to be called when the joystick axis value changes.
- Parameters
-
callback | A reference to a function. |
◆ position()
int32_t vex::controller::axis::position |
( |
percentUnits | units = percentUnits::pct | ) |
const |
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. |
◆ value()
int32_t vex::controller::axis::value |
( |
void | | ) |
const |
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.
The documentation for this class was generated from the following file: