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

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

Detailed Description

Use this class when programming with a motor connected to a victor motor controller.

Constructor & Destructor Documentation

◆ motor_victor() [1/2]

vex::motor_victor::motor_victor ( triport::port port)

Creates a new motor victor object on the port specified in the parameter.

Parameters
portA reference to a three wire port.

◆ motor_victor() [2/2]

vex::motor_victor::motor_victor ( triport::port port,
bool  reverse 
)

Creates a new motor victor object on the port specified in the parameter.

Parameters
portA reference to a three wire port.
reverseSets the reverse flag for the new motor_victor object.

◆ ~motor_victor()

vex::motor_victor::~motor_victor ( )

Member Function Documentation

◆ setVelocity()

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.

Parameters
velocitySets the amount of velocity.
unitsThe measurement unit of the velocity value.

◆ setReversed()

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.

Parameters
valueIf set to true, the motor will spin in the reversed direction.

◆ spin() [1/3]

void vex::motor_victor::spin ( directionType  dir)

Turns the motor on, and spins it in the specified direction.

Parameters
dirThe direction to spin the motor.

◆ spin() [2/3]

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.

Parameters
dirThe direction to spin the motor.
velocitySets the amount of velocity.
unitsThe measurement unit of the velocity value.

◆ spin() [3/3]

void vex::motor_victor::spin ( directionType  dir,
double  velocity,
percentUnits  units 
)
inline

◆ stop()

void vex::motor_victor::stop ( void  )

Stops the motor using the default brake mode.