Mini Challenge 1: Threshold Values
The waitUntil (Distance Sensor) command uses a "Threshold" cutoff value to determine when to wait, and when to continue with the program.
|
Can't remember how to control the TouchLEDs? Review it again from Page 3 of the Touch Sensor chapter.
Use multiple waitUntil commands in your program.
Make sure the robot is moving backwards so that it moves with its Distance Sensor facing the front.
Make sure your motor speed is low enough so the robot has time to display the different colors of the Touch LED Sensor.
Mini Challenge 2: Move Until Far
Thresholds divide Distance Sensor values into two categories:waitUntil(Distance Sensor < threshold) waits until something is "Near" the sensor. This works well to detect a "far" away object that gets "near" because the robot moves toward it.
|
Make sure the robot is moving forward so that it moves with the Distance Sensor facing the wall.
Did you know?
How the Distance Sensor works
The Distance Sensor
uses the speed that sound waves travels to measure distance to an object!
|