motor55#

To make motor55 commands appear in VEXcode V5, a Motor Controller 55 must be configured in the Devices window.

For more information, refer to these articles:

Initializing the motor55 Class#

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

Parameter

Description

port

A valid Smart Port that the GPS Sensor is connected to.

// 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.

Parameter

Description

port

A valid Smart Port that the GPS Sensor is connected to.

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.

Parameter

Description

port

A valid Smart Port that the GPS Sensor is connected to.

maxv

Sets the maximum drive voltage in volts for the DC Motor.

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.

Class Methods#

setReversed()#

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

Parameters

Description

value

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

Returns: None.

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.

Parameters

Description

velocity

Sets the amount of velocity.

units

Velocities can only be expressed in percentage for a MC55.

Returns: None.

setStopping()#

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

Parameters

Description

mode

The stopping mode can be set to coast or brake, hold is not supported on the MC55.

Returns: None.

spin()#

This is a non-waiting method and allows the next method to run without delay.

This method is called in the following ways:

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

Parameters

Description

direction

The direction to spin the Motor.

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

Parameters

Description

direction

The direction to spin the Motor.

voltage

Sets the amount of volts.

units

The measurement unit for the voltage value.

Returns: None.

stop()#

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

Returns: None.

setMaxTorque()#

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

Parameters

Description

value

Sets the amount of torque.

units

The unit for the torque value, only amp is supported for an MC55.

Returns: None.

current()#

This method is called in the following ways:

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

Parameters

Description

units

The measurement unit for the current.

Returns: A double that represents the electrical current of the Motor in the units defined in the parameter.

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

Parameters

Description

units

The measurement unit for the current.

Returns: A double that represents the electrical current of the Motor as percentage of max current.

voltage()#

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

Parameters

Description

units

The measurement unit for the voltage.

Returns: A double that represents the electrical voltage of the Motor in the units defined in the parameter.

temperature()#

This method is called in the following ways:

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

Parameters

Description

units

The measurement unit for the temperature.

Returns: A double that represents the temperature of the Motor in the units defined in the parameter.

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

Parameters

Description

units

The measurement unit for the temperature.

getMotorType()#

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

Returns: An integer that returns the type of the Motor, 0 is 11W, 1 is 5.5W, 2 is MC55.

timestamp()#

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

Returns: Timestamp of the last status packet as an unsigned 32-bit integer in milliseconds.