Page 255 - Lego Mindstorms
P. 255

Robot 9 • The SpinnerBot
































                      As a designer, you’ll always be striving to squeeze a few more features into
                      your robot without using any more RCX outputs. Using only two motors, the
                      SpinnerBot allows you to experiment with driving, grabbing, lifting, and
                      replacing objects. This robot gets its name from the fact that it spends a lot of
                      time spinning: In order to navigate, it either moves forward or turns to the left.
                      Nevertheless, the SpinnerBot can get wherever it needs to go using these two
                      abilities, and when it gets there, it can grab and lift objects using the gripper
                      arm powered by the second motor. The SpinnerBot uses touch sensors to detect
                      the flags it collects, and it uses a light sensor in order to stay within the bounds
                      of the dark oval on the Test Pad (the Test Pad is the large printed sheet that
                      came with your RIS 2.0 kit).
                         Using the language NQC (Not Quite C), I have written a Capture-the-Flag
                      program for the robot, which hunts around the confines of the Test Pad for a
                      specially designed flag. When the robot encounters a flag, it captures it using
                      the grabbers, and lifts it off the ground using the lift arm. As a further chal-
                      lenge, you might try setting up your own arena with a dark border and a
                      medium-shaded “home” area. You could then program SpinnerBot to search
                      for flags outside its home, retrieve them, and deposit them in its nest. You can
                      find the Capture-the-Flag program on the Syngress Solutions Web site
                      (www.syngress.com/solutions).













                                                        240
   250   251   252   253   254   255   256   257   258   259   260