We can calculate how much time the motor should turn at a given velocity in order for it to reach the required position, but this will not be necessary. In such cases, it would be much easier to use the run_angle().

To access the full video please subscribe to FLLCasts.com
- #1559
- 06 Mar 2020
This command has four input parameters:
- The speed at which the motor turns;
- How many degrees the motor should turn at;
- What type of brake it should use;
- Whether or not the program should wait for the command to complete its action.
Here's an example of how the robot can be programmed to move a single motor to 90 degrees with a speed of 360:
Motor(Port.B).run_angle(360, 90)
If we wish to turn the motor in reverse, we can use one of two options:
- Set it to a negative speed:
Motor(Port.B).run_angle(-360, 90)
- Set it to a negative angle:
Motor(Port.B).run_angle(360, -90)
If you set a negative angle and negative speed, the motor will reverse its direction twice and it will move forward:
Motor(Port.B).run_angle(-360, -90)
You can follow this link to read about this command in the pybricks documentation.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons

Python with LEGO Mindstorms EV3 - Level 1
The course introduces students to the programming language Python. We use LEGO Mindstorms EV3 Robots. Python is a popular programming language. It could be used for introducing students to programming, for academic studies, for developing machine learning algorithms and as a general-purpose language.
During the course, students learn how to read and how to develop Python programs. They use an Integrated Development Environment called Visual Studio Code. Robots are programmed to perform interesting and funny tasks like "bringing you water". The level ends with competition on a playing field with boxes.
- 74
- 28:18
- 114

Lesson 5 - Educational toy: Learn to read the clock
Remember to provide feedback to students regularly. It's important to give structured feedback in the form of a grade. Today, you'll need to grade your students following this article.
- 7
- 10
- 16
- 3d_rotation 1