Victor Motor#

Introducción#

El Controlador de Motor VEX Victor es un controlador de motor de generaciones anteriores que recibe una señal PWM de 3 cables del Brain para controlar los motores de CC VEXpro/EDR que no se pueden conectar directamente a los Smart Ports.

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

A continuación se muestra una lista de los métodos disponibles:

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

  • stop – Stops a motor immediately.

  • set_velocity – Tells a motor how fast to spin.

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

Constructor – Inicialice manualmente un controlador de motor Victor.

girar#

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

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

Parámetros

Descripción

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 to spin with from 0% to 100% when using PERCENT. This can be an integer or decimal (float). If the velocity is not specified or previously set, the default velocity is 50%.

units

Optional. The velocity unit:

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

detener#

stop stops the connected motor immediately.

Usage:
victor_motor.stop()

Parámetros

Descripción

Este método no tiene parámetros.

establecer_velocidad#

set_velocity tells a motor how fast to spin. A higher percentage makes the motor spin faster and a lower percentage makes the motor spin slower.

Every project begins with each connected motor spinning at 50% velocity by default.

Usage:
victor_motor.set_velocity(value, units)

Parámetro

Descripción

velocity

The velocity to spin with from 0% to 100% when using PERCENT. This can be an integer or decimal (float).

units

Optional. The velocity unit:

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

Usage:
victor_motor.set_reversed(value)

Parámetros

Descripción

value

Whether the motor’s direction is reversed:

  • True — Reverses the motor’s direction.
  • False — Returns the motor’s direction to its default.

Constructores#

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

MotorVictor#

MotorVictor creates a Victor Motor Controller.

Usage:
MotorVictor(port, reverse)

Parámetro

Descripción

port

The 3-Wire Port that the Controller is connected to:

  • On the EXP Brainbrain.three_wire_port.x 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)