Skip to main content

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 Simple Clawbot collect a cube 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 Cube. View the animation below for an example of the how your Simple Clawbot could move to detect the color of the cubes and move only the red cube to complete the challenge.

In this animation, the Simple Clawbot begins along the left wall of the Field. There are five cubes places against the wall to the left of the robot, at each black line. The second cube is red. The robot repeatedly drives forward to the black line, turns left, and drives forward to detect the color of the cube. If the cube is not red, the robot reverses, turns right, and continues its pattern. If the cube is red, the robot grasps it in its claw, reverses, turns around, and drives to deliver the cube to the opposite wall. The timer runs until the robot has checked the color of all five cubes, about 32 seconds.

Video file

Select Next > to learn about the Optical Sensor and the blocks you can use to build a project to collect a red cube.