Moving the motors for a set time Pro Preview

To move a motor, we set the speed at which we want to move, the amount of time we want it to move and the way we want it to stop. There is a command that allows you to set all these parameters at once.

To access the full video please subscribe to FLLCasts.com

Subscribe

  • #1534
  • 15 Feb 2020

The command is:

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

This command has 4 input parameters, but we will use just 3 of them, namely:

  1. Speed - the first parameter in the "run_time()", 45 in the example above;
  2. Time - the second parameter in the "run_time()" command, 2000 in the example above;;
  3. Brake - the third parameter in the "run_time()", Stop.HOLD in the example above.

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