mBot |
|
Your mBot is equipped with its very own light sensor. This means that it can sense the degree of light that is present in the room.
With this in mind, you need to program your mBot so that it automatically spins around in circles whenever you cover it with something like a textbook, a binder or an agenda. Then, the mBot needs to immediately stop spinning once it is no longer covered.
To get started, add the following code to your project:
With this in mind, you need to program your mBot so that it automatically spins around in circles whenever you cover it with something like a textbook, a binder or an agenda. Then, the mBot needs to immediately stop spinning once it is no longer covered.
To get started, add the following code to your project:
Then click the Green Flag to start the program. The value picked up by the light sensor will now constantly be displayed on the screen (in the Panda's speech bubble). The higher the number, the more light it is detecting.
Now cover the mBot (again, use something like a textbook, a binder or an agenda). You should see that the value picked up by the light sensor changes whenever you do this. It should be lower now.
You should now be ready to make the mBot spin when it's covered and freeze when it's not covered.
Try to figure this out on your own first. Take your time. Don't be in a rush.
If you REALLY need help, let Mr. Locke know and he might show you a hint. Maybe.
Now cover the mBot (again, use something like a textbook, a binder or an agenda). You should see that the value picked up by the light sensor changes whenever you do this. It should be lower now.
You should now be ready to make the mBot spin when it's covered and freeze when it's not covered.
Try to figure this out on your own first. Take your time. Don't be in a rush.
If you REALLY need help, let Mr. Locke know and he might show you a hint. Maybe.