Grupo Motor#
Para que los comandos MotorGroup aparezcan en VEXcode V5, se debe configurar un motor en la ventana Dispositivos.
Para obtener más información, consulte estos artículos:
grupo_motor.spin()#
The motor_group.spin(direction, velocity, units) command spins all motors in the group using the provided arguments.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
A valid |
|
Optional. Spin the motor using this velocity, the default velocity set by |
|
Optional. A valid |
Devoluciones: Ninguna.
# Spin the motor group forward for 2 seconds.
motor_group_1.spin(FORWARD)
wait(2, SECOND)
# Stop spinning the motor group.
motor_group_1.stop()
grupo_motor.girar_a_posición()#
The motor_group.spin_to_position(rotation, units, velocity, units_v, wait) command spins all motors in the group to an absolute position using the provided arguments.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
La posición a la que debe girar el motor. |
|
Optional. A valid |
|
Opcional. Gire el motor usando esta velocidad, se utilizará la velocidad predeterminada establecida por set_velocity si no se proporciona. |
|
Optional. A valid |
|
Optional. Determines whether the command will block subsequent commands ( |
Devoluciones: Ninguna.
grupo_motor.spin_for()#
The motor_group.spin_for(direction, value, units, velocity, units_v, wait) command spins all motors in the group to a relative position using the provided arguments.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
A valid |
|
El valor al que debe girar el grupo motor. |
|
Optional. A valid |
|
Opcional. Gire el motor usando esta velocidad, se utilizará la velocidad predeterminada establecida por set_velocity si no se proporciona. |
|
Optional. A valid |
|
Optional. Determines whether the command will block subsequent commands ( |
Devoluciones: Ninguna.
# Spin 180 degrees from the current position.
motor_group_1.spin_for(FORWARD, 180)
grupo_motor.stop()#
The motor_group.stop() command is used to stop a motor group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Devoluciones: Ninguna.
# Spin the motor group forward for 2 seconds.
motor_group_1.spin(FORWARD)
wait(2, SECOND)
# Stop spinning the motor group.
motor_group_1.stop()
grupo_motor.count()#
The motor_group.count() command returns the number of motors in the group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Devuelve: El número de motores en el grupo.
grupo_motor.establecer_velocidad()#
The motor_group.set_velocity(velocity, units) command sets the default velocity for all motors in the group. This will be the velocity used for subsequent calls to spin if a velocity is not provided to that function.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
La nueva velocidad a establecer para el grupo motor. |
|
Optional. A valid |
Devoluciones: Ninguna.
grupo_motor.set_stopping()#
The motor_group.set_stopping(mode) command sets the stopping mode for all motors in the group. Setting the action for the motor when stopped.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
A valid |
Devoluciones: Ninguna.
grupo_motor.reset_position()#
The motor_group.reset_position() command resets the motor group position to 0.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Devoluciones: Ninguna.
grupo_motor.establecer_posición()#
The motor_group.set_position(value, units) command sets the current position for all motors in the group. The position returned by the motor_group.position() function is set to this value.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
La nueva posición. |
|
Optional. A valid |
Devoluciones: Ninguna.
grupo_motor.establecer_tiempo_de_espera()#
The motor_group.set_timeout(timeout, units) command sets the timeout value used for all motors in the group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
El nuevo tiempo de espera. |
|
Optional. A valid |
Devoluciones: Ninguna.
grupo_motor.está_girando()#
The motor_group.is_spinning() command returns if the motor group is currently spinning.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Returns: True if the motor group is currently spinning. False if it is not.
grupo_motor.está_hecho()#
The motor_group.is_done() command returns if the motor group has completed its movement.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Returns: True if the motor group has completed its movement. False if it has not.
grupo_motor.establecer_par_máximo()#
The motor_group.set_max_torque(value, units) command sets the maximum torque all motors in the group will use. The torque can be set as torque, current, or percent of maximum.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
El nuevo par máximo a utilizar. |
|
Optional. A valid |
Devoluciones: Ninguna.
grupo_motor.dirección()#
The motor_group.direction() command returns the current direction the motor group is spinning in.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Returns: The current DirectionType the motor group is spinning in.
grupo_motor.posición()#
The motor_group.position(units) command returns the position of the first motor.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. A valid |
Devuelve: La posición actual del grupo de motores en las unidades especificadas.
grupo_motor.velocidad()#
The motor_group.velocity(units) command returns the current velocity of the motor group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. A valid |
Devuelve: La velocidad actual del grupo de motores en las unidades especificadas.
grupo_motor.actual()#
The motor_group.current(units) command returns the current being used by the motor group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. The only valid unit for current is |
Devuelve: La corriente consumida por el grupo de motores en las unidades especificadas.
grupo_motor.potencia()#
The motor_group.power(units) command returns the power being consumed by the motor group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. The only valid unit for power is |
Devuelve: La potencia consumida por el grupo de motores en las unidades especificadas.
grupo_motor.torque()#
The motor_group.torque(units) command returns the torque the first motor is providing.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. A valid |
Devuelve: El torque generado por el grupo de motores en las unidades especificadas.
grupo_motor.eficiencia()#
The motor_group.efficiency(units) command returns the efficiency of the motor group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. The only valid unit for efficiency is |
Devuelve: La eficiencia del grupo motor como porcentaje.
motor_group.temperature()#
The motor_group.temperature(units) command returns the temperature of the motor group.
Este es un comando sin espera y permite que el siguiente comando se ejecute sin demora.
Parámetros |
Descripción |
|---|---|
|
Optional. A valid |
Devuelve: La temperatura del grupo de motores en las unidades especificadas.