"> ");
Hi guys!
In a previous lesson, we had seen Edison adores the light. In fact, we had driven it by making it follow the light of a torch.
This time, we will try to do the opposite! So, we will make Edison avoid the light! Of course, to do this, we will write a program using EdBlocks.
This program needs the function of Edison’s light sensors.
Do you remember Edison’s light sensors?
There are two of them. One on the right and one on the left at the front side of the robot.
With those sensors, Edison can figure out from which side most of the light is coming.
So, he can move towards the light, to follow it.
However, he can also move toward the other side and avoid it. That is precisely what we are going to do in this activity.
Using EdBlocks, we write the program you see.
What does the program “tells” Edison to do?
When the light comes from the right side, the program tells him to turn left... and when the light comes from the left side, the program tells him to turn right.
So, the robot avoids the light!
This can continue “forever” because of the loop.
Also, with that block, we can control Edison’s speed.
Let’s download our program to Edison and play a game.
We will put Edison inside a circle, and we will try to keep him inside using a torch.
Remember that, now, our robot avoids the light!
Perfect! We have just played the cockroach game.
It is called like that because in this game our robot is continually avoiding the light, as cockroaches do.
This behavior in nature is called negative phototropism.
On the contrary, when an organism is attracted to the light, like moths, we say we have positive phototropism.
You can play the cockroach game with another friend who has Edison.
Put the two robots inside the circle and try to push the other robot out of the circle!
The one who remains in the circle at the end is a winner!
Try different speeds on the two robots. Which robot do you think will win?