VEXcode Doxygen
Classes | Public Member Functions | Public Attributes | Protected Member Functions | 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...

#include <vex_controller.h>

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...
 
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...
 

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...
 
lcdLCD = Screen
 

Protected Member Functions

int32_t _getIndex ()
 

Detailed Description

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

@prog_lang{block|cpp|pro}

Constructor & Destructor Documentation

◆ controller() [1/2]

vex::controller::controller ( )

Creates a new controller object.

@prog_lang{cpp|pro} @drawer_cat{constructor} @block_sig{vex::controller Controller = vex::controller();}

◆ controller() [2/2]

vex::controller::controller ( controllerType  id)

Creates a new controller object.

@prog_lang{cpp|pro} @drawer_cat{constructor} @block_sig{vex::controller Controller = vex::controller(vex::controllerType::partner);}

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

Member Function Documentation

◆ 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.

@prog_lang{block|cpp|pro} @drawer_cat{action} @block_sig{Controller.rumble(".-.-");}

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

Member Data Documentation

◆ Axis1

axis& vex::controller::Axis1 = AxisC

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

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.Axis1}

◆ Axis2

axis& vex::controller::Axis2 = AxisD

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

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.Axis2}

◆ Axis3

axis& vex::controller::Axis3 = AxisA

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

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.Axis3}

◆ Axis4

axis& vex::controller::Axis4 = AxisB

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

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.Axis4}

◆ ButtonA

button& vex::controller::ButtonA = button8Right

A button that represents the A button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonA}

◆ ButtonB

button& vex::controller::ButtonB = button8Down

A button that represents the B button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonB}

◆ ButtonDown

button& vex::controller::ButtonDown = button7Down

A button that represents the down button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonDown}

◆ ButtonL1

button& vex::controller::ButtonL1 = button5Up

A button that represents the L1 button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonL1}

◆ ButtonL2

button& vex::controller::ButtonL2 = button5Down

A button that represents the L2 button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonL2}

◆ ButtonLeft

button& vex::controller::ButtonLeft = button7Left

A button that represents the left button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonLeft}

◆ ButtonR1

button& vex::controller::ButtonR1 = button6Up

A button that represents the R1 button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonR1}

◆ ButtonR2

button& vex::controller::ButtonR2 = button6Down

A button that represents the R2 button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonR2}

◆ ButtonRight

button& vex::controller::ButtonRight = button7Right

A button that represents the right button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonRight}

◆ ButtonUp

button& vex::controller::ButtonUp = button7Up

A button that represents the up button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonUp}

◆ ButtonX

button& vex::controller::ButtonX = button8Up

A button that represents the x button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonX}

◆ ButtonY

button& vex::controller::ButtonY = button8Left

A button that represents the Y button on the controller.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.ButtonY}

◆ Screen

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

Controller's instance of LCD.

@prog_lang{block|cpp|pro} @drawer_cat{instance} @block_sig{Controller.Screen}


The documentation for this class was generated from the following file: