Motor Controller (MC) 55#
To make Motor Controller 55 blocks appear in VEXcode V5, a Motor Controller 55 must be configured in the Devices window.
For more information, refer to these articles:
Spin Motor Controller 55#
The Spin Motor Controller 55 block is used to spin a DC Motor forever, until a new Motion block is used or the program is stopped.
This is a non-waiting block and allows any subsequent blocks to execute without delay.
spin [MC55_7 v] [forward v]
Select which DC Motor to use.
Select which direction for the DC motor to move in.
In this example, the DC motor will spin forward for 2 seconds before stopping.
when started :: hat events
spin [MC55_7 v] [forward v]
wait (2) seconds
stop [MC55_7 v]
Spin Motor Controller 55 at Voltage#
The Spin Motor Controller 55 at Voltage block is used to spin a DC Motor at a specified voltage.
This is a non-waiting command and allows any subsequent commands to execute without delay.
spin [MC55_7 v] [forward v] at (8) volts
Select which DC Motor to use.
Select which direction for the motor or motor group to move in.
The Spin Motor Controller 55 at Voltage block accepts a range from -8V to 8V.
Spinning a DC Motor at a negative voltage will cause the Motor to spin in the opposite direction than the one specified.
In this example, the DC Motor will spin forward at 4 volts for 2 seconds before stopping.
Stop Motor Controller 55#
The Stop Motor Controller 55 block is used to stop a DC Motor from moving.
This is a non-waiting block and allows any subsequent blocks to execute without delay.
stop [MC55_7 v]
Select which DC Motor to use.
In this example, the DC motor will spin forward for 2 seconds before stopping.
when started :: hat events
spin [MC55_7 v] [forward v]
wait (2) seconds
stop [MC55_7 v]
Set Motor Controller 55 Velocity#
The Set Motor Controller 55 Velocity block is used to set the speed of a DC Motor.
This is a non-waiting block and allows any subsequent blocks to execute without delay.
set [Motor1 v] velocity to (5) [% v]
Select which DC Motor to use.
The Set Motor Controller 55 Velocity block will accept a range of -100% to 100%.
Setting a DC Motor’s velocity to a negative value will cause the DC Motor to spin in reverse and setting the velocity to 0 will cause the DC Motor to stop.
In this example, the DC Motor will spin forward for 1 second before setting the motor’s velocity to 100%.
when started :: hat events
spin [Motor1 v] [forward v] for (1) [turns v] ▶
set [Motor1 v] velocity to (75) [% v]
spin [Motor1 v] [reverse v] for (1) [turns v] ▶
Set Motor Controller 55 Stopping#
The Set Motor Controller 55 Stopping block is used to set the behavior of the DC Motor when it stops moving.
This is a non-waiting block and allows any subsequent blocks to execute without delay.
set [MC55_7 v] stopping to [brake v]
Select which DC Motor to use.
Select which stopping behavior to use.
The two drive stopping behaviors are as follows:
brake - The motor or motor group will come to an immediate stop.
coast - The motor or motor group will spin gradually to a stop.
By default, the DC Motor stopping behavior is brake.
In this example, the DC Motor spins for 2 seconds before coasting to a stop.
when started :: hat events
[Set the DC Motor's stopping behavior to coast]
set [MC55_7 v] stopping to [forward v]
[Spin forward for two seconds before coasting to a stop]
spin [MC55_7 v] [forward v]
wait (2) seconds
stop [MC55_7 v]