Introduction
In this Lesson you will learn about the Optical Sensor, and how it can be used with [If then] and [Repeat] blocks in a project to make your Clawbot collect a Buckyball based on its color. Then you will apply what you have learned to compete in the Treasure Mover Challenge, where your robot will need to collect only the red Treasure Buckyball. Watch the animation below to see an example of how a robot could autonomously move during a successful run in the Treasure Mover Challenge.
In this animation, the Clawbot begins along the left wall of the Field. There are two Buckyballs placed against the wall to the left of the robot, at each black line. The second Buckyball is red. The robot repeatedly drives forward to the black line, turns left, and drives forward to detect the color of each Buckyball. If the Buckyball is not red, the robot reverses, turns right, and continues its pattern. If the Buckyball is red, the robot grasps it in its claw, reverses, turns around, and drives to deliver the Buckyball to the opposite wall. The timer runs until the robot has checked the color of all five Buckyballs, about 28 seconds.
Add an Optical Sensor
In this Lesson, you learn about sensor feedback and how you can code your robot using that feedback.
Add an Optical Sensor to your Clawbot as shown in this image.
- Connect a 1x2x1x4 C-Channel to an Optical Sensor.
- Mount the C-Channel to an angled gusset, then attach this to the claw.
Select Next > to learn about the Optical Sensor and the blocks you can use to build a project to collect a red Buckyball.