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

Use this class when programming with an accelerometer sensor. More...

Inherits vex::__tridevice.

Public Member Functions

 accelerometer (triport::port &port)
 Creates a new accelerometer object on the port specified in the parameter. More...
 
 ~accelerometer ()
 
int32_t value (analogUnits units)
 Gets the value of the accelerometer. More...
 
int32_t value (percentUnits units)
 Gets the value of the accelerometer. More...
 

Detailed Description

Use this class when programming with an accelerometer sensor.

Constructor & Destructor Documentation

◆ accelerometer()

vex::accelerometer::accelerometer ( triport::port port)

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

Parameters
portA reference to a three wire port.

◆ ~accelerometer()

vex::accelerometer::~accelerometer ( )

Member Function Documentation

◆ value() [1/2]

int32_t vex::accelerometer::value ( analogUnits  units)

Gets the value of the accelerometer.

Returns
Returns an integer that represents the unit value specified by the parameter of the accelerometer sensor.
Parameters
unitsThe measurement unit for the accelerometer device.

◆ value() [2/2]

int32_t vex::accelerometer::value ( percentUnits  units)
inline

Gets the value of the accelerometer.

Returns
Returns an integer that represents the unit value specified by the parameter of the accelerometer sensor.
Parameters
unitsThe measurement unit for the accelerometer device.