|
VEX V5 C++ API
|
Use this class when programming with a motor connected to a victor motor controller. More...
Inherits vex::__tridevice.
Public Member Functions | |
| motor_victor (triport::port &port) | |
| Creates a new motor victor object on the port specified in the parameter. More... | |
| motor_victor (triport::port &port, bool reverse) | |
| Creates a new motor victor object on the port specified in the parameter. More... | |
| ~motor_victor () | |
| 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 with a motor connected to a victor motor controller.
| vex::motor_victor::motor_victor | ( | triport::port & | port | ) |
Creates a new motor victor object on the port specified in the parameter.
| port | A reference to a three wire port. |
| vex::motor_victor::motor_victor | ( | triport::port & | port, |
| bool | reverse | ||
| ) |
Creates a new motor victor object on the port specified in the parameter.
| port | A reference to a three wire port. |
| reverse | Sets the reverse flag for the new motor_victor object. |
| vex::motor_victor::~motor_victor | ( | ) |
| void vex::motor_victor::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::motor_victor::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::motor_victor::spin | ( | directionType | dir | ) |
Turns the motor on, and spins it in the specified direction.
| dir | The direction to spin the motor. |
| void vex::motor_victor::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::motor_victor::stop | ( | void | ) |
Stops the motor using the default brake mode.
1.8.15