motor55#

Para que los comandos motor55 aparezcan en VEXcode V5, se debe configurar un Controlador de motor 55 en la ventana Dispositivos.

Para obtener más información, consulte estos artículos:

Inicializando la clase motor55#

This motor55 constructor creates an object of the motor55 Class in the specified port.

Parámetro

Descripción

port

Un Puerto inteligente válido al que está conectado el sensor GPS.

// Construct a Motor Controller 55 "MC55_1" with the
// motor55 class.
motor55 MC55_1 = motor55(PORT1);

This motor55 constructor creates an object of the motor55 Class in the specified port and allows the reversing of the Motor Controller 55’s spin direction.

Parámetro

Descripción

port

Un Puerto inteligente válido al que está conectado el sensor GPS.

reverse

true to reverse the Motor Controller 55’s spin direction. false does not reverse the spin direction.

// Construct a Motor Controller 55 "MC55_1" with the
// motor55 class with a reverse spin direction.
motor55 MC55_1 = motor55(PORT1, false);

This motor55 constructor creates an object of the motor55 Class in the specified port and allows the reversing of the Motor Controller 55’s spin direction and sets a maximum drive voltage for the DC Motor.

Parámetro

Descripción

port

Un Puerto inteligente válido al que está conectado el sensor GPS.

maxv

Establece el voltaje de accionamiento máximo en voltios para el motor de CC.

reverse

true to reverse the Motor Controller 55’s spin direction. false does not reverse the spin direction.

// Construct a Motor Controller 55 "MC55_1" with the
// motor55 class with a reverse spin direction and
// a maximum drive voltage of 50 volts.
motor55 MC55_1 = motor55(PORT1, 50, false);

This MC55_1 object will be used in all subsequent examples throughout this API documentation when referring to motor55 class methods.

Métodos de clase#

setReversed()#

The setReversed(value) method sets the Motor mode to “reverse”, which will make Motor commands spin the Motor in the opposite direction.

Parámetros

Descripción

valor

If set to true, Motor commands spin the Motor in the opposite direction.

Devoluciones: Ninguna.

setVelocity()#

The setVelocity(velocity, units) method sets the velocity of the Motor based on the parameters set in the method. This method will not run the Motor. Any subsequent call that does not contain a specified Motor velocity will use this value.

Parámetros

Descripción

velocidad

Establece la cantidad de velocidad.

unidades

Las velocidades solo se pueden expresar en porcentaje para un MC55.

Devoluciones: Ninguna.

setStopping()#

The Motor55.setStopping(mode) method sets the stopping mode of the Motor by passing a brake mode as a parameter.

Parámetros

Descripción

modo

El modo de parada se puede configurar para que funcione por inercia o con frenado; la retención no es compatible con el MC55.

Devoluciones: Ninguna.

spin()#

Este es un método sin espera y permite que el siguiente método se ejecute sin demora.

Este método se llama de las siguientes maneras:

The spin(direction) method turns the Motor on and spins it in the specified direction.

Parámetros

Descripción

dirección

La dirección para girar el motor.

The spin(direction, voltage, units) method turns on the Motor and spins it in a specified direction and a specified voltage.

Parámetros

Descripción

dirección

La dirección para girar el motor.

Voltaje

Establece la cantidad de voltios.

unidades

La unidad de medida para el valor de voltaje.

Devoluciones: Ninguna.

stop()#

The stop() method stops the Motor using the default brake mode.

Devoluciones: Ninguna.

setMaxTorque()#

The setMaxTorque(value, units) method sets the max torque of the Motor.

Parámetros

Descripción

valor

Establece la cantidad de torque.

unidades

La unidad para el valor de torque, solo amperio, es compatible con un MC55.

Devoluciones: Ninguna.

current()#

Este método se llama de las siguientes maneras:

The current(units) method gets the electrical current of the Motor.

Parámetros

Descripción

unidades

La unidad de medida de la corriente.

Devuelve: Un doble que representa la corriente eléctrica del motor en las unidades definidas en el parámetro.

The current(units) method gets the electrical current of the Motor in percentage of maximum.

Parámetros

Descripción

unidades

La unidad de medida de la corriente.

Devuelve: Un doble que representa la corriente eléctrica del motor como porcentaje de la corriente máxima.

voltage()#

The voltage(units) method gets the electrical voltage of the Motor.

Parámetros

Descripción

unidades

La unidad de medida del voltaje.

Devuelve: Un doble que representa el voltaje eléctrico del motor en las unidades definidas en el parámetro.

temperature()#

Este método se llama de las siguientes maneras:

The temperature(units) method gets the temperature of the Motor.

Parámetros

Descripción

unidades

La unidad de medida de la temperatura.

Devuelve: Un doble que representa la temperatura del motor en las unidades definidas en el parámetro.

The temperature(units) method gets the temperature of the Motor.

Parámetros

Descripción

unidades

La unidad de medida de la temperatura.

getMotorType()#

The getMotorType() method gets the type of the Motor, 11W, 5.5W, or MC55.

Devuelve: Un entero que devuelve el tipo de motor, 0 es 11 W, 1 es 5,5 W, 2 es MC55.

timestamp()#

The timestamp() method requests the timestamp of the last received status packet from the Motor.

Devuelve: Marca de tiempo del último paquete de estado como un entero de 32 bits sin signo en milisegundos.