VEX V5 C++ API
|
Use this class when programming a motor connected to a motor controller 29. More...
Inherits vex::__tridevice.
Public Member Functions | |
motor29 (triport::port &port) | |
Creates a new motor29 object on the port specified in the parameter. More... | |
motor29 (triport::port &port, bool reverse) | |
Creates a new motor29 object on the port specified in the parameter. More... | |
~motor29 () | |
void | setVelocity (double velocity, percentUnits units) |
Sets the velocity of the motor based on the parameters set in the command. This command will not run the motor. Any subsequent call that does not contain a specified motor velocity will use this value. More... | |
void | setReversed (bool value) |
Sets the motor mode to "reverse", which will make motor commands spin the motor in the opposite direction. More... | |
void | spin (directionType dir) |
Turns the motor on, and spins it in the specified direction. More... | |
void | spin (directionType dir, double velocity, velocityUnits units) |
Turns on the motor and spins it in a specified direction and a specified velocity. More... | |
void | spin (directionType dir, double velocity, percentUnits units) |
void | stop (void) |
Stops the motor using the default brake mode. More... | |
Use this class when programming a motor connected to a motor controller 29.
vex::motor29::motor29 | ( | triport::port & | port | ) |
Creates a new motor29 object on the port specified in the parameter.
port | A reference to a three wire port. |
vex::motor29::motor29 | ( | triport::port & | port, |
bool | reverse | ||
) |
vex::motor29::~motor29 | ( | ) |
void vex::motor29::setVelocity | ( | double | velocity, |
percentUnits | units | ||
) |
Sets the velocity of the motor based on the parameters set in the command. This command will not run the motor. Any subsequent call that does not contain a specified motor velocity will use this value.
velocity | Sets the amount of velocity. |
units | The measurement unit of the velocity value. |
void vex::motor29::setReversed | ( | bool | value | ) |
Sets the motor mode to "reverse", which will make motor commands spin the motor in the opposite direction.
value | If set to true, the motor will spin in the reversed direction. |
void vex::motor29::spin | ( | directionType | dir | ) |
Turns the motor on, and spins it in the specified direction.
dir | The direction to spin the motor. |
void vex::motor29::spin | ( | directionType | dir, |
double | velocity, | ||
velocityUnits | units | ||
) |
Turns on the motor and spins it in a specified direction and a specified velocity.
dir | The direction to spin the motor. |
velocity | Sets the amount of velocity. |
units | The measurement unit of the velocity value. |
|
inline |
void vex::motor29::stop | ( | void | ) |
Stops the motor using the default brake mode.