Page 302 - LEGO MINDSTORMS - Robotics Invention System-2 Projects
P. 302
Robot 9 • The SpinnerBot
on the middle of one of the straight sides of the oval, and put the SpinnerBot
somewhere within the oval.
When you run the program, the SpinnerBot will begin by lowering its
lift arm and opening the grippers. (If this doesn’t happen, see the earlier
Troubleshooting section.) Now the robot is ready to grab any flag it encounters.
SpinnerBot will then begin traveling straight ahead until it encounters a black
line or bumps a flag. When it encounters a black line, it should back up while
turning right until it clears the line, and then resume its advance. Upon
bumping the flag, SpinnerBot will stop moving and will activate its grippers.
The grippers will close on the shaft of the flag, grabbing it firmly. Once the
grippers are closed, the arm will begin to lift the flag over the top of the robot.
After lifting the flag, the Spinner will shut down, having completed its task.
Advanced Challenges
The SpinnerBot is a capable platform for programming advanced robot behav-
iors. Try out some of the following tasks to test your robotics mettle:
After the robot captures a flag, have it play a sound, and set the flag
down again. Have it back away from the flag, drive off in another
direction, and then continue searching for other flags.
Change the behavior of the robot when it encounters a black
boundary line. By executing a larger turn, or a random-distance turn,
your robot will zig-zag across the Test Pad rather than following the
line closely.
Wire each of the touch sensors separately so that the SpinnerBot can
tell which direction an obstacle is in.
Add an additional sensor from another LEGO set, and use it for more
complex behaviors, such as detecting the edge of a table or deter-
mining whether the grippers missed the flag.
Wire the touch sensors to the same input as the light sensor, and treat
extremely high light readings as touch-sensor events. This frees
another sensor input, so now SpinnerBot can detect a table edge and
tell whether it has successfully grabbed a flag.
Use black tape to outline your own roaming area.
Place a sheet of medium-colored paper within the SpinnerBot’s terri-
tory. Program it to bring capture flags back to its “home” and deposit
them there.
Build a basket above the RCX, and remove the three-quarter-length
pin from the Spinner Arms sub-assembly that limits the upper range
of the arm’s motion. Now the SpinnerBot will release a captured flag
into the basket. Go flag collecting!
288