Best practices for creating long programs by trial and error Pro Preview

Now that you have tried and solved a challenge with a series of instructions, we would like to share with you a few best practices.

  • #413
  • 15 Mar 2017
  • 2:51

Try blocks one by one

It is a bad practice to place several blocks and then experiment what happens. The problem is that when there is an error, you can't pinpoint which block causes the problem.

Understand the challenge

In order to solve a task correctly, you must make sure you understand what is expected from you. So make sure you articulate the way you understood the challenge and ask your teacher if that understanding is correct.
You can ask us too in the comments section below.

Test each step of the program with the robot

This is the most important message we have here! Follow this algorithm:

  • Place one or two blocks in your program and adjust them;
  • Download the program from the computer to the robot;
  • Take the robot to the floor and place it the marked starting position;
  • Select the program from the block menus and start it;
  • Observe the results and decide if the robot behaves as desired:
    • If the behavior is "correct", as desired, go ahead
      • Add new blocks to the program, extend the program;
    • If there is an error, it is in the new blocks that you just added.
      • Correct the error and observe again.

Use the download option of the software

This way you have control where and when you start the robot. If necessary, you can start the program from the brick several times.


When building a program with a series of instructions at the end we have the following program.

That was the Yo-yo challenge. And there are a couple of best practices of how you should develop such programs and in this video I'd like to discuss these best practices.

Now, this is a complex program because it involves several blocks. And it is not a good idea to place all the blocks at once and to try to run the program because it will not work correctly. So, you should try do develop the program in small steps. First, the most important thing, understand the challenge. You can ask for some clarification from the instructor, from the teacher. You can also comment below the video or look for answers in the comment sections. So, you should understand the whole challenge. Then create a program using only one or two blocks. Download the program from the computer to the robot. And you can use Bluetooth, you can use USB. But after you've implemented a program with one or two blocks you just download this program to the brick. And now I'll download my program right here.

Just download without running. Then you take the robot, place it on the floor where you have the starting position and from the menu you select the program that you want to run. And press the button.

So, we have the first two blocks of the challenge. We observe them and we decide, okay, this is something correct. Then we can extend this program. If the behavior is not correct, we can change it. But if it is correct, we just extend it. In this way we have in small steps developing the program. And we know exactly where the error is if there is an error. Because we don't move forward until we have the small fragment of the program working, these small one or two blocks. That's why it's important that you use the download option. Because you can actually take the robot, place it, run and then observe the behavior of the robot.

Courses and lessons with this Tutorial

This Tutorial is used in the following courses and lessons

Image for EV3 Phi. Introduction to robotics with LEGO Mindstorms
Course icon fllcasts
  • 92
  • 220:20
  • 36
Image for The Yo Yo challenge
Lesson icon fllcasts
  • 8
  • 0
  • 3
  • 3d_rotation 0
Image for Level A1. Introduction. Robotics with LEGO
Course icon fllcasts
  • 119
  • 98:29
  • 173
Image for Lesson 2 - Yo-yo challenge
Lesson icon fllcasts
  • 18
  • 3
  • 8
  • 3d_rotation 1
Image for Instructors Remote Training
Course icon fllcasts
  • 135
  • 280:11
  • 156
Image for How to make the robot move
Lesson icon fllcasts
  • 24
  • 0
  • 11
  • 3d_rotation 0
Image for Robotics with LEGO - Level 1.0 - Adventure in Space
Course icon fllcasts
  • 121
  • 120:50
  • 136