VEX V5 C++ API
|
Use this class when programming with an encoder. More...
Inherits vex::__tridevice.
Public Member Functions | |
encoder (triport::port &port) | |
Creates a new encoder object on the port specified in the parameter. More... | |
~encoder () | |
int32_t | value () |
Gets the value of the encoder. More... | |
operator int () | |
void | resetRotation (void) |
Resets the rotation of the encoder to zero. More... | |
void | setRotation (double val, rotationUnits units) |
Sets the rotation of the encoder to a specific value. More... | |
double | rotation (rotationUnits units) |
Gets the rotation value of the encoder. More... | |
double | velocity (velocityUnits units) |
Gets the velocity of the encoder. More... | |
Use this class when programming with an encoder.
vex::encoder::encoder | ( | triport::port & | port | ) |
Creates a new encoder object on the port specified in the parameter.
port | A reference to a three wire port. |
vex::encoder::~encoder | ( | ) |
int32_t vex::encoder::value | ( | ) |
Gets the value of the encoder.
vex::encoder::operator int | ( | ) |
void vex::encoder::resetRotation | ( | void | ) |
Resets the rotation of the encoder to zero.
void vex::encoder::setRotation | ( | double | val, |
rotationUnits | units | ||
) |
Sets the rotation of the encoder to a specific value.
val | Sets the amount of rotation. |
units | The measurement unit for the rotation value. |
double vex::encoder::rotation | ( | rotationUnits | units | ) |
Gets the rotation value of the encoder.
units | The measurement unit for the encoder device. |
double vex::encoder::velocity | ( | velocityUnits | units | ) |
Gets the velocity of the encoder.
units | The measurement unit for the encoder device. |