
212 CHAPTER 15
programming
and testing
guard-bot
For Guard-Bot, the primary programming challenge is keep-
ing its legs synchronized. To begin, however, we’ll program
Guard-Bot as a stationary motion detector that guards a
single pathway or object. Then we’ll program Guard-Bot to
walk around the NXT test pad and search for intruders that
come within a certain distance. In both scenarios, Guard-Bot
puts its ball-launching mechanism to use!
guard-bot: the motion
detector
Figure 15-3 shows our first program, Guard-Bot1, in which
Guard-Bot simply sits still and detects any motion with its
ultrasonic sensor. How does this program give Guard-Bot
the ab ...