The connections of the EV3 robot's engines
A: Hand-propeller
B: Right foot
C: Left foot
2 Steps forward, 2 steps back
First of all, let's look at how to teach the robot to make 2 steps forward and 2 steps back.
The left foot's engine turns a little, then we do a little move with the hand, as if the robot was dancing, then we turn the right foot's engine a little, and again, a little hand-movement.
Next, we'd like to make 2 steps back. But our engines are moving the foots of the robot forwards. So, first we need to reverse the engines, with the two blue boxes below:
Because the engines are going backwards now, we can do the very same two steps we earlier did to make the robot take two steps back.
But remember, next time the robot needs to go forward again, so we should turn the engines back again:
Because we'd like to do the same two steps forward - two steps back a couple of times, we're placing these instructions inside a loop, and make it repeat for example 3 times. To make the party last longer, the number can also be higher.
Make your own Block
Until now we have built a very loong program, it almost does not fit our screen. We also had to repeat some steps twice.
Before we add more steps to our program, let me show you how you can shorten it down!
First select the 4 blocks with the two steps and the two propeller movements until they get a light blue highlight like this. You can select them by holding down the 'Shift' key, and clicking on each of them.
Then click on the 'Tools' Menü, and click 'My Block Builder'.
Here you can put in any name for your new block, for instance '2Steps'. Finish.
After this you can find your new block in the last tab of your Mindstorms EV3 editor.
Turn Around
So we made some more space for turning around, here is how we can turn both engines at the same time, in opposite directions to let the Mindstorms turn around:
Enjoy building and programming the robot!







Keine Kommentare:
Kommentar veröffentlichen