Introduction
In this Lesson, you will learn about the Optical Sensor, and how you can use sensor feedback to optimize your strategy and your code for playing Castle Crasher. You will also learn how to create an algorithm to code your robot to autonomously find Buckyballs and complete the Sweep the Field challenge. Watch the animation below to see an example of how the robot could move to detect and clear Buckyballs from the Field without falling off the edge.
Add an Optical Sensor
In this Lesson, you learn about the Optical Sensor, and explore how to use it with the Distance Sensor to create an algorithm.
Add the Optical and Distance Sensors to your BaseBot as shown in this image.
- Add a 1x2x1x16 C-Channel to the front of the BaseBot as shown.
- Then, mount the Distance Sensor to the C-Channel facing out, as shown in the image.
- Add the Optical Sensor pointing down.
- The Distance Sensor should be plugged into Port 5, and the Optical Sensor into Port 1.
Select < Return to Lessons to return to the Lesson Overview.
Select Next > to learn about the Optical Sensor and how you can use sensor feedback and algorithms to code your robot to find and push Buckyballs off a Field.