Victor Motor#

Introduction#

The VEX Victor Motor Controller is a legacy motor controller that takes a 3-Wire PWM signal from the Brain to control VEXpro/EDR DC motors that can’t plug directly into Smart Ports.

This page uses victor_motor as the example Victor Motor Controller name. Replace it with your own configured name as needed.

Below is a list of available methods:

  • spin – Spins a motor forward or reverse until stopped.

  • stop – Stops a motor immediately.

  • set_velocity – Sets a motor’s speed as a percentage.

  • set_reversed – Sets a motor to have its direction be reversed.

Constructor – Manually initialize a Victor Motor Controller.

spin#

spin rotates a connected motor in a specified direction using the current motor velocity.

Usage:
victor_motor.spin(direction, velocity, units)

Parameters

Description

direction

The direction in which to spin the motor:

  • FORWARD – By default, this is counterclockwise
  • REVERSE – By default, this is clockwise

velocity

Optional. The velocity at which the motor will spin as a float or integer. If the velocity is not specified or previously set, the default velocity is 50%.

units

Optional. The unit that represents the velocity:

  • PERCENT
  • RPM (default) – Rotations per minute
  • VelocityUnits.DPS – Degrees per second

stop#

stop stops the connected motor immediately.

Usage:
victor_motor.stop()

Parameters

Description

This method has no parameters.

set_velocity#

set_velocity sets the default spinning speed of a motor for all subsequent Victor Motor methods in the project.

Usage:
victor_motor.set_velocity(value, units)

Parameter

Description

velocity

The velocity at which the motor will spin as a float or integer.

units

Optional. The unit that represents the velocity:

  • PERCENT
  • RPM (default) – Rotations per minute
  • VelocityUnits.DPS – Degrees per second

set_reversed#

set_reversed sets the motor to be reversed so that the FORWARD direction will spin clockwise. This method works the same as setting the reverse parameter to True when constructing a Motor29.

Usage:
victor_motor.set_reversed(value)

Parameters

Description

value

Boolean value to set the direction reversed or not:

  • True – Reverse the motor’s direction
  • False – Return the motor’s direction to its default

Constructors#

Constructors are used to create Motor29 objects, which are necessary for configuring a Victor Motor Controller.

MotorVictor#

MotorVictor creates a Victor Motor Controller.

Usage:
MotorVictor(port, gears, reverse)

Parameter

Description

port

The 3-Wire Port that the V5 Pneumatic Solenoid is connected to:

  • On the V5 BrainPorts.PORTx where x is the number of the port.
  • On a 3-Wire Expanderexpander.a where expander is the name of the expander instance.

reverse

Optional. Sets whether the motor’s spin should be reversed.

  • TrueFORWARD will spin clockwise
  • False (default) – FORWARD will spin counterclockwise

# Create a Victor Motor Controller in Port A
victor_motor = MotorVictor(brain.three_wire_port.a)