This block will run the motor, connected to a specified hub port, at a specified power.
Run motor block as first input accepts Hub port address. Each hub port has a physical letter printed on its body.
Run motor block as a second input accepts motor power value. Values can range from -100 to 100. When the value is a positive number, the motor spins clockwise, when the value is a negative number, the motor spins counterclockwise.
The coding block is compatible with all hubs.
The coding block is compatible with motors that have a speed sensor.
Device name | Compatible |
WeDo 2.0 Medium Motor | no |
Medium Linear Motor | yes |
Technic™ Large Motor | yes |
Technic™ XL Motor | yes |
Technic™ Small Angular Motor | yes |
Medium Angular Motor | yes |
Large Angular Motor | yes |
Train Motor | yes |
Move Hub | yes |
LEGO® Powered UP App coding example: Run motor
For this example, you will need:
- Hub – any hub from Hubs compatible with LEGO® Powered UP App list will work
- Motor – any motor that has speed sensor from Motors compatible with LEGO® Powered UP App list will work
Step 1: Add coding blocks
- Flow block – Start
- Motor block – Run motor, select hub port A, select power 100
Step 2: Setup motor and hub
- Connect the motor to port A
- Connect the hub to a device that runs the Powered UP App
Step 3: Run the program. Observe that the motor is spinning at full power. Observe, that when you start the program and change power value, nothing changes. For changes to apply in this example, you need to restart the program.
Leave a Reply Cancel reply