I think that now you know Edison very well!
We drove it with clapping; with the remote control, we made it to avoid obstacles, we made him follow the light, the lines... even sumo wrestle!
But how did the robot know what to do each time?
If you remember, before each activity, we made Edison scan the corresponding barcode. By scanning the barcode he was loading into his memory the corresponding program. The program then tells him what to do!
The time has come to build our program! how will we do it?
By using and combining blocks, the EdBlocks! Edblocks is a programming language for robots, which we can use to program Edison.
You can program Edison to do different things with Edblocks!
Let’s see how Edblocks work.
Imagine making a cake. How would you know what to do?
Of course, you would read the recipe. When we read a recipe, we follow every single step:
First we collect all the ingredients. Then we put them in a bowl.
Then we mix them all together. Then we bake it in the oven. As a last step we put the syrup!
It's the same with Edison: He follows every step accordingly.
That means that he follows each block from the Edblocks.
Edison reads the blocks of Edblocks from left to right, starting from the 1st one and continuing with the next one in a row -one block each at a time-, until he reads them all.
So Edison follows the same instructions, but in a different way.
Let’s practice a little bit with Edblocks.
We need to get Edison to do several things, one by one
Good! So let’s make him do the following:
First, he should drive forward for two seconds.
Then, he should turn left for 0.4 seconds.
Third, he should turn on the right LED light.
Fourth, he should drive backwards for 3 seconds. And fifth it should turn right for 0.9 seconds.
Let’s look at the following blocks.
We need those blocks to write the program we said, but they are not in the right order.
We begin with this block. With this one, He drives forward... with this one he turns left... with this it turns on the right light...with this one he drives backwards and finally with this one it turns right...
Here, we write how many seconds we want him to be turning right.
Now, let’s organise the blocks in the correct order.
First, he drives forward... for 2 seconds...
then he turns left... for 0.4 seconds...
After that, we turn on the right red light ...
then he drives backwards... for 3 seconds...
and finally he turns right…for 0.9 seconds.
Let’s see what Edison will do.