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

Use the controller class to get values from the remote controller as well as write to the controller's screen. More...

Classes

class  axis
 Use the axis class to get values from one of the controller's joysticks. More...
 
class  button
 Use the button class to get values from the controller's buttons. More...
 
class  lcd
 Use this class to write to the controller's LCD screen. More...
 

Public Member Functions

 controller ()
 Creates a new controller object. More...
 
 controller (controllerType id)
 Creates a new controller object. More...
 
 ~controller ()
 
bool installed ()
 
void rumble (const char *str)
 Rumbles the controller by a pattern defined by the parameter. Dots equal short, dashes equal long and space equals pause. More...
 
void setDeadband (int32_t deadband, percentUnits units)
 set the value of the controller axis deadband (minimum absolute threshold at which position is reported as non-zero) More...
 
int32_t deadband (percentUnits units)
 get the value of the controller axis deadband More...
 

Static Public Member Functions

static controller_getDevice (controllerType type)
 

Public Attributes

buttonButtonL1 = button5Up
 A button that represents the L1 button on the controller. More...
 
buttonButtonL2 = button5Down
 A button that represents the L2 button on the controller. More...
 
buttonButtonR1 = button6Up
 A button that represents the R1 button on the controller. More...
 
buttonButtonR2 = button6Down
 A button that represents the R2 button on the controller. More...
 
buttonButtonUp = button7Up
 A button that represents the up button on the controller. More...
 
buttonButtonDown = button7Down
 A button that represents the down button on the controller. More...
 
buttonButtonLeft = button7Left
 A button that represents the left button on the controller. More...
 
buttonButtonRight = button7Right
 A button that represents the right button on the controller. More...
 
buttonButtonX = button8Up
 A button that represents the X button on the controller. More...
 
buttonButtonB = button8Down
 A button that represents the B button on the controller. More...
 
buttonButtonY = button8Left
 A button that represents the Y button on the controller. More...
 
buttonButtonA = button8Right
 A button that represents the A button on the controller. More...
 
axisAxis1 = AxisC
 An axis of a joystick that represents axis 1 on the controller. More...
 
axisAxis2 = AxisD
 An axis of a joystick that represents axis 2 on the controller. More...
 
axisAxis3 = AxisA
 An axis of a joystick that represents axis 3 on the controller. More...
 
axisAxis4 = AxisB
 An axis of a joystick that represents axis 4 on the controller. More...
 
lcd Screen = lcd(this)
 Controller's instance of LCD. More...
 

Detailed Description

Use the controller class to get values from the remote controller as well as write to the controller's screen.

Constructor & Destructor Documentation

◆ controller() [1/2]

vex::controller::controller ( )

Creates a new controller object.

◆ controller() [2/2]

vex::controller::controller ( controllerType  id)

Creates a new controller object.

Parameters
idThe type of controller that is being created. This can be set to primary or partner.

◆ ~controller()

vex::controller::~controller ( )

Member Function Documentation

◆ installed()

bool vex::controller::installed ( )

◆ rumble()

void vex::controller::rumble ( const char *  str)

Rumbles the controller by a pattern defined by the parameter. Dots equal short, dashes equal long and space equals pause.

Parameters
strA string that consists of dots and dashes that represent the rumble pattern.

◆ _getDevice()

static controller* vex::controller::_getDevice ( controllerType  type)
static

◆ setDeadband()

void vex::controller::setDeadband ( int32_t  deadband,
percentUnits  units 
)

set the value of the controller axis deadband (minimum absolute threshold at which position is reported as non-zero)

◆ deadband()

int32_t vex::controller::deadband ( percentUnits  units)

get the value of the controller axis deadband

Member Data Documentation

◆ ButtonL1

button& vex::controller::ButtonL1 = button5Up

A button that represents the L1 button on the controller.

◆ ButtonL2

button& vex::controller::ButtonL2 = button5Down

A button that represents the L2 button on the controller.

◆ ButtonR1

button& vex::controller::ButtonR1 = button6Up

A button that represents the R1 button on the controller.

◆ ButtonR2

button& vex::controller::ButtonR2 = button6Down

A button that represents the R2 button on the controller.

◆ ButtonUp

button& vex::controller::ButtonUp = button7Up

A button that represents the up button on the controller.

◆ ButtonDown

button& vex::controller::ButtonDown = button7Down

A button that represents the down button on the controller.

◆ ButtonLeft

button& vex::controller::ButtonLeft = button7Left

A button that represents the left button on the controller.

◆ ButtonRight

button& vex::controller::ButtonRight = button7Right

A button that represents the right button on the controller.

◆ ButtonX

button& vex::controller::ButtonX = button8Up

A button that represents the X button on the controller.

◆ ButtonB

button& vex::controller::ButtonB = button8Down

A button that represents the B button on the controller.

◆ ButtonY

button& vex::controller::ButtonY = button8Left

A button that represents the Y button on the controller.

◆ ButtonA

button& vex::controller::ButtonA = button8Right

A button that represents the A button on the controller.

◆ Axis1

axis& vex::controller::Axis1 = AxisC

An axis of a joystick that represents axis 1 on the controller.

◆ Axis2

axis& vex::controller::Axis2 = AxisD

An axis of a joystick that represents axis 2 on the controller.

◆ Axis3

axis& vex::controller::Axis3 = AxisA

An axis of a joystick that represents axis 3 on the controller.

◆ Axis4

axis& vex::controller::Axis4 = AxisB

An axis of a joystick that represents axis 4 on the controller.

◆ Screen

lcd vex::controller::Screen = lcd(this)

Controller's instance of LCD.