VEX IQ C++ API
Public Member Functions | List of all members
vex::bumper Class Reference

Use this class when programming with the bumper device. More...

Inherits vex::device.

Public Member Functions

 bumper (int32_t index)
 Creates a new bumper object on the port specified in the parameter. More...
 
 ~bumper ()
 
int32_t value ()
 Gets the value of the bumper device. More...
 
int32_t pressing ()
 Get the pressed status of the bumper device. More...
 
- Public Member Functions inherited from vex::device
 device (int32_t index)
 
 ~device ()
 

Additional Inherited Members

- Protected Attributes inherited from vex::device
int32_t _index
 

Detailed Description

Use this class when programming with the bumper device.

Constructor & Destructor Documentation

◆ bumper()

vex::bumper::bumper ( int32_t  index)
inline

Creates a new bumper object on the port specified in the parameter.

Parameters
indexThe port index for this motor. The index is zero-based.

◆ ~bumper()

vex::bumper::~bumper ( )
inline

Member Function Documentation

◆ value()

int32_t vex::bumper::value ( )

Gets the value of the bumper device.

Returns
Returns an integer that represents the value of the bumper device.

◆ pressing()

int32_t vex::bumper::pressing ( )
inline

Get the pressed status of the bumper device.

Returns
Returns the state of the bumper device. If it is pressed it will return a one. If unpressed, it will return a zero.