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 name | Compatible |
WeDo 2.0 Medium Motor | yes |
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: Stop motor
For this example, you will need:
- Hub – any hub from Hubs compatible with LEGO® Powered UP App list will work
- Motor – any motor from Motors compatible with LEGO® Powered UP App list will work
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:
- Navigate to the Application control view
- Observe that when the program starts, the motor is spinning
- Press the Canvas Button
- Observe that after pressing the button the motor stops immediately