Motor brakes in Python for EV3 Pro Preview

LEGO motors have embedded brakes and they can be used to halt the movement of a motor, resist the turning of a motor or to actively restore the position, at which the motor was at when the brakes were activated.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1533
  • 15 Feb 2020

Stopping the motors with no brakes

Motor(Port.D).stop()

This command stops the movement of the motors without actively resisting any further rotations caused by external forces.

Stopping the motors with brakes

Motor(Port.D).brake()

This command stops the motors and actively resists further rotations caused by external forces.

Stopping the motors and maintaining their position

Motor(Port.D).hold()

This activates the strongest brakes in the motors. With it, the motors are stopped and a movement in the opposite direction is activated at any attempt of turning the motor further. This way the motor maintains the angle at which it has stopped.

Caution: The brakes will disengage when the program ends.

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for Python with LEGO Mindstorms EV3 - Level 1
  • 74
  • 28:18
  • 114
Image for Lesson 2 - Robotic arm
  • 10
  • 5
  • 9
  • 3d_rotation 1