Stop motor

This block will stop the motor, connected to a specified port.

Stop motor motor accepts port address as an input.
Stop motor input port address should be the same as the motor, You want to stop

This 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: Stop motor

For this example, you will need:

Step 1: Add coding blocks

  • Flow block – Start  
  • Motor block – Start motor, select hub port A, and select power 50 (any power value, that enables the motor to spin will work)
  • Flow block – Start 
  • Motor block – Stop motor, select hub port A
  • Widget – Button widget with address 0

Step 2: Add Canvas Button with address 0

Step 3: Setup motor and hub

  • Connect the motor to port A
  • Connect the hub to a device that runs the Powered UP App

Step 4:

  1. Navigate to the Application control view
  2. Observe that when the program starts, the motor is spinning
  3. Press the Canvas Button
  4. Observe that after pressing the button the motor stops immediately

Back to Motor Blocks page