Run a simple motor block

This block will run the motor, connected to a specified hub port, at a specified power.

Run a simple motor block as first input accepts Hub port address. Each hub port has a physical letter printed on its body.

Run a simple 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 will all hubs and motors.

Device nameCompatible
WeDo 2.0 Medium Motoryes
Medium Linear Motoryes
Technic™ Large Motoryes
Technic™ XL Motoryes
Technic™ Small Angular Motoryes
Medium Angular Motoryes
Large Angular Motoryes
Train Motoryes
Move Hubyes

LEGO® Powered UP App coding example: Run a simple motor

For this example, you will need:

Step 1: Add coding blocks

  • Flow block – Start  
  • Motor block – Run a simple 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.

Back to Motor Blocks page