How to set the brakes as an input parameter in commands Pro Preview

Some commands have a specific input parameter designed for the type of brake. If this input parameter is not entered, the commands stop with a brake and maintains the position of the wheels.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1639
  • 24 Aug 2020

In the commands input parameters, the brake is set via the "Stop" class.

Stopping engines without brakes

To stop motors without a brake, you can use "Stop.COAST".

Example:

Motor(Port.D).run_time(45, 2000, Stop.COAST)

Stopping engines with brakes

To stop the motors with the brake, you can use "Stop.BRAKE".

Example:

Motor(Port.D).run_time(45, 2000, Stop.BRAKE)

Stopping the engines and maintaining their position

You can use "Stop.HOLD" to stop the motors and make the robot maintain its position.

Example:

Motor(Port.D).run_time(45, 2000, Stop.HOLD)

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
  • 72
  • 28:18
  • 113
Image for Lesson 2 - Robotic arm
  • 10
  • 5
  • 9
  • 3d_rotation 1