VEXcode IQ C++ Unofficial documentation for version 3.0.4.1
Loading...
Searching...
No Matches
vex::bumper Class Reference
Inheritance diagram for vex::bumper:
vex::device

Public Member Functions

 bumper (int32_t index)
 Creates a new bumper object on the port specified in the parameter.
 
bool installed ()
 
int32_t value ()
 Gets the value of the bumper device.
 
int32_t pressing ()
 Get the pressed status of the bumper device.
 
void pressed (void(*callback)(void))
 Calls a function when the bumper switch is pressed.
 
void released (void(*callback)(void))
 Calls a function when the bumper switch is released.
 
- Public Member Functions inherited from vex::device
 device (int32_t index)
 
IQ_DeviceType type ()
 
int32_t index ()
 
void init (int32_t index)
 
int32_t readDigitalPin ()
 
int32_t readAnalogPin ()
 

Additional Inherited Members

- Protected Member Functions inherited from vex::device
void setPollInterval (int32_t value)
 
bool pollValid (bool bSave)
 
- Protected Attributes inherited from vex::device
int16_t _index
 

Detailed Description

Definition at line 26 of file vex_bumper.h.

Constructor & Destructor Documentation

◆ bumper()

vex::bumper::bumper ( int32_t index)

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

Parameters
portindex to the brain port.

Member Function Documentation

◆ installed()

bool vex::bumper::installed ( )
virtual

Reimplemented from vex::device.

◆ pressed()

void vex::bumper::pressed ( void(* callback )(void))

Calls a function when the bumper switch is pressed.

Parameters
callbackA reference to a function.

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

Definition at line 48 of file vex_bumper.h.

◆ released()

void vex::bumper::released ( void(* callback )(void))

Calls a function when the bumper switch is released.

Parameters
callbackA reference to a function.

◆ value()

int32_t vex::bumper::value ( )
virtual

Gets the value of the bumper device.

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

Reimplemented from vex::device.


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