Let's code the robot to perform different tasks
This robot is on a mission to identify various minerals on the surface of the moon. First, use your sticky notes and create the following setup:
Here, blue represents iron, green represents copper, and yellow represents gypsum.
Activity #1
Write a program so that your rover does the following:
- Stops on any colored line (blue, green, or yellow) on its route.
- If blue is detected, wait for 2 seconds and display Iron found!.
- If green is detected, wait for 2 seconds and display Copper found!.
- If yellow is detected, wait for 2 seconds and display Gypsum found!.
The sample code for the activity is given here:
You can use sound blocks at the respective locations to make this project more interactive. The program should work for all iterations of the colored sticky notes. Any sequence should work.
...