rewriting the GentleStop program
Recall that the GentleStop program makes the TriBot slow down and gently stop as it approaches a wall. The robot stops when the Power setting for the Move blocks is too low to make the robot move, but a better approach would be to stop the motors when the robot is close to the wall, instead of letting the motors stall. In this section, you’ll rewrite the GentleStop program to do just that, using the output from the Ultrasonic Sensor block as the trigger for a Switch block. The program will work like the original, but you’ll use a different approach to programming it.
You’ll write the program in two parts. In the first part, you’ll make the TriBot move forward and then stop when the reading from the Ultrasonic Sensor ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access