So far we have created programs that execute actions one after another. But sometimes we need to perform two actions at the same time. How do we achieve that?

Необходимо е да се абонирате за FLLCasts.com, за да достъпите това видео
- #1170
- 22 Mar 2019
The setup
For example, if we want to program our robot to move along a given field and meanwhile it needs to move a hand with another motor(s). To be more precise let us say that we want our robot to move along a square and move a medium motor 240 degrees forward, then 240 degrees backward.
The problem
Each of the above tasks is relatively easy. The following program will make the robot to move in a square:
and the following program will make its hand move back and forth as described:
The problem arises when we want to perform the above two programs simultaneously.
The solution
In such cases, we need multiple threads. When computers have some actions to be performed they order them in threads. Each thread is executed by executing each of the tasks within one by one. If you need to perform two groups of actions simultaneously, you just need a new thread, so that each group will run in its own thread.
Курсове и занятия включващи този Урок
Този Урок е използван в следните курсове и занятия.

Instructors Remote Training
If you are working with students and you want to introduce Robotics to your class or you want to mentor a FLL team, but you are insecure about your technical knowledge in the Robotics field, then this is the right place for you. Having in mind teachers' busy schedule, we have design two different schedules and added an option to design one just for you. FLLCasts's Mindstorms EV3 Robotics Online Training is the perfect match for any teacher.
After the completion of each task the participant has to upload his solution for verification.
- 183
- 280:11
- 156

Threads and Multi-threading
So far we have created programs that execute actions one after another. But sometimes we need to perform two actions at the same time. How do we achieve that?
- 5
- 1
- 9
- 3d_rotation 1