Let's make a program that moves the robot forward and then backward.
- 04 Feb 2017
- LEGO MINDSTORMS
- EV3, Classes with students, Programming
- K.Mitov, A.Pavlov, M.Grozev, С.Матинян, D.Staykov, I.Gerginov, А.Павлов
A program as a series of instructions
Drag and drop a second block to the programming canvas of the software. You can add new blocks either before, or after existing blocks.
A computer program is a series of instructions or commands that are executed one after the other.
How to delete a wrong block
If you need to remove a block, you could drag it back to the palette section and drop it there. The delete button will do the same if you prefer to use the keyboard.
Our robot moves forward and we can also program the robot to move backward. Let me just find my program.
Like this. Now, in this video we must improve on the program so that it moves forward, backward, forward, backward, etc. We'll set this as a challenge. We'll show you part of the solution and then we'll leave you to experiment with the different tasks. So, let's first implement a program so that it moves forward and backward.
This here is a program for moving backward. You see -1 as rotations and we can drag and drop one more block into the program. We can drop the block as a last block or as a first block. Let's just drop it as a first block. Now, this program will make the robot move forward for one rotation backward for -1 rotation. And that's important because this is what programming looks like. You just add a number of blocks in a series and you reach a behavior of the robot. In this case forward, backward. Let's download it and run it.
Again, I'll have to find it.
Forward, backward. What you need to do from here is to just add more blocks to the program and configure their settings. And you reach a final program that makes the robot moves like a Yo-yo. And you'll need.. You have to find out how many blocks you'll need. Now, it's possible that you make a mistake. Like clicking on another block and even placing it. You can delete this block. You just drag and drop this block back to the pallet. Like this.
Or you can just use the Delete key. You just select the block and press delete. So, the task from here is to implement the Yo-yo. To do it on your own by adding more blocks to the program.
Courses and lessons with this Tutorial
This Tutorial is used in the following courses and lessons