Medium Motor Block

The Medium Motor block controls the Medium Motor. You can turn the motor on or off, control its power level, or turn the motor on for a specified amount of time or rotations.
Choose your Motor Port and Control Mode


Port selector
Mode selector
Inputs


Select the motor (A, B, C, or D) that you want the Medium Motor block to control by using the Port Selector on the top of the block.

Use the Mode Selector to select how you want to control the motor. After selecting the mode, you can choose values for the inputs. The inputs available will change depending on the mode. The modes and inputs are described below.
Modes
On


The On mode turns the motor on, then immediately continues to the next block in the program. You can control the speed and direction of the motor using the Power input. The motor will run until it is stopped or changed by another block later in the program, or until the program ends.
Example
Use the On mode when you want other blocks in your program to control how long the motor stays on. In this program, the motor will run until a touch sensor is pressed, and then it is stopped.
Off


The Off mode turns the motor off. It is usually used to stop a motor that was started by the On mode. See the example above.

If Brake at End is True, the motor is stopped immediately. The motor will be held in its stopped position until another Motor block starts that motor, or until the program ends. If Brake at End is False, power to the motor is simply turned off. The motor will coast using any remaining momentum until it stops, or until another Motor block starts.
Tips and Tricks
You can use the Off mode with Brake at End set to False to “release” a motor that is being held in a stopped position. This can, for example, allow you to adjust the motor’s position by hand in the middle of a program.
On For Seconds


On for Seconds turns the motor on for the number of seconds in the Seconds input, then turns it off. The block will wait until the time has passed before the program will continue to the next block.

You can control the speed and direction of the motor using the Power input. Use True for Brake at End to stop the motor after exactly the specified number of seconds.
Tips and Tricks
You can use a decimal point in the Seconds input to get an exact amount of time, such as 3.5 for three and a half seconds, and 0.25 seconds for one quarter of a second.
On For Degrees


On for Degrees turns the motor on for the number of degrees specified in the Degrees input, then turns it off. 360 degrees results in one full turn or rotation of the motor.

You can control the speed and direction of the motor using the Power input. Use True for Brake at End to stop the motor after exactly the specified number of degrees.
Example
This program will run the motor on port A at 50% power for exactly 900 degrees (two and a half rotations), and then stop it.
Tips and Tricks
The Medium Motor’s internal rotation sensor measures the degrees of rotation. When using On for Degrees, the block will wait until the motor has turned exactly the number of degrees specified before the program will continue to the next block. If the motor encounters resistance or a physical limit, and it is unable to complete the specified number of degrees, the block will continue waiting. No other blocks in the program will execute until the resistance is removed.
On For Rotations


On for Rotations turns the motor on for the number of rotations in the Rotations input, then turns it off.

You can control the speed and direction of the motor using the Power input. Use True for Brake at End to stop the motor after exactly the specified number of rotations.
Tips and Tricks
The On for Rotations mode is exactly the same as the On for Degrees mode, except it uses a different unit of rotation. You can also use a decimal point in the Rotations input to get part of a rotation. The following table shows two different ways to get the same amount of rotation.
RotationsDegrees
1360
2720
0.5180
1.25450
7.22592
Motor Power and Direction
The Power input accepts a number from -100 to 100. A positive number turns the Medium Motor clockwise, and a negative number turns it counter-clockwise, as shown in the graphic below.





Positive Power
Negative Power

You can change the normal rotation direction for a motor using the Invert Motor block. If a motor direction has been inverted, the effect of positive and negative power levels will be the opposite of that shown above.
Tips and Tricks
The rotation speed of a motor will be roughly proportional to the power level specified, although rotation speed is also affected by how much load is put on the motor.
Inputs
The inputs of the Medium Motor block control the details of how the motor will operate. You can enter the input values directly into the block. Alternatively, the values can be supplied by Data Wires from the outputs of other Programming Blocks. The inputs available and their functions depend on the control mode you selected.
InputTypeAllowed ValuesNotes
Power Numeric-100 to 100Motor power level.

See Motor Power and Direction.
Brake at End LogicTrue/FalseApplies when the block finishes.

If True, the motor is stopped immediately and is held in position.

If False, motor power stops and the motor is allowed to coast.
Seconds Numeric≥ 0Movement time in seconds.
Degrees NumericAny NumberAmount of movement in degrees. 360 degrees make a full rotation.
Rotations NumericAny NumberAmount of movement in rotations. 
Medium Motor
Quick links