the GentleStop program

The GentleStop program is designed to show you how to use a data wire. The program moves the TriBot forward and then makes it gradually slow down and then stop when it reaches a wall.

Key to this program is that the speed of the TriBot depends on how far it is from the wall, as shown in Figure 8-1. As the robot moves closer to the wall, its speed smoothly decreases until it stops. To accomplish this feat, you’ll combine the features of an Ultrasonic Sensor block and a Move block. The Ultrasonic Sensor block will measure how far the robot is from the wall, and the Move block will use this value for its Power setting to control the robot’s speed. Figure 8-2 shows how these two blocks will be connected in the program.

As the ...

Get The Art of LEGO MINDSTORMS NXT-G Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.