Victor Motor#
Introducción#
El controlador de motor VEX Victor es un controlador de motor heredado que toma una señal PWM de 3 cables del cerebro para controlar los motores de CC VEXpro/EDR que no se pueden conectar directamente a los puertos inteligentes.
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– Sets a motor’s speed as a percentage.set_reversed– Sets a motor to have its direction be reversed.
Constructor: inicializa manualmente un controlador de motor Victor.
MotorVictor– Creates a Victor Motor Controller.
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 |
|---|---|
|
The direction in which to spin the motor:
|
|
Opcional. La velocidad a la que girará el motor, como valor de punto flotante o entero. Si no se especifica la velocidad o se estableció previamente, la velocidad predeterminada es del 50 %. |
|
Optional. The unit that represents the velocity:
|
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 sets the default spinning speed of a motor for all subsequent Victor Motor methods in the project.
Usage:
victor_motor.set_velocity(value, units)
Parámetro |
Descripción |
|---|---|
|
La velocidad a la que girará el motor como un número flotante o entero. |
|
Optional. The unit that represents the velocity:
|
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)
Parámetros |
Descripción |
|---|---|
|
Boolean value to set the direction reversed or not:
|
Constructores#
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)
Parámetro |
Descripción |
|---|---|
|
The 3-Wire Port that the V5 Pneumatic Solenoid is connected to:
|
|
Optional. Sets whether the motor’s spin should be reversed.
|
# Create a Victor Motor Controller in Port A
victor_motor = MotorVictor(brain.three_wire_port.a)