
program-
ming and
testing
tag-bot
Programming Tag-Bot poses certain
challenges. Tag-Bot must not only
determine when a bright light has
shone on its light sensor for more than
a specified amount of time, but it also
must detect and maneuver around
obstacles as it runs around the room.
We’ll begin with a basic approach to
accomplishing these tasks. Then we’ll
enhance the program by giving Tag-Bot
the ability to look at different paths with
its ultrasonic sensor and choose one
path over another based on how far it
can travel before having to maneuver
around an object.
NOTE Remember that all of the
NXT-G programs used by the robots
in this book ar ...