the BumperBot program
Now that you know how the Touch Sensor works, let’s put it to use. In this section, you’ll build the BumperBot program, which uses the bumper on the front of the TriBot to help the robot wander around a room. When the robot runs into something, the Touch Sensor will be pressed. The program will react by making the TriBot back up, turn around, and then start again. The robot keeps going until you stop it by pressing the Exit button on the NXT.
When the BumperBot program runs, the robot should keep moving in a straight line until it runs into something. A Move block with the Duration item set to Unlimited will move the robot forward until its movement is stopped by another Move block. A Wait block using the Touch Sensor tells ...
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