Page 260 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 260

Amphibionics 06  3/24/03  9:02 AM  Page 239
                                       Chapter 6 / Crocobot: Build Your Own Robotic Crocodile
                                                                                   FIGURE 6.55
                                                                                   Transmitter components
                                                                                   wired to connectors.



















                        Programming Crocobot

                        To bring the crocodile robot to life, the leg sensor switches will be
                        checked to make sure that they are working properly. The leg sen-
                        sor  switches  will  be  used  to  coordinate  the  walking  gait  of  the
                        robot. With the two-motor, four-leg design that has been used, it
                        is necessary for one set of legs to be in the forward position when
                        the other set of legs are in motion. Otherwise, the robot does not
                        get maximum body lift or forward/reverse motion. The first pro-
                        gram that will be written is called crocobot-switch.bas and is list-
                        ed in Program 6.1. Enter the program into your favorite text edi-
                        tor, then compile and program the PIC 16F84 using the crocobot-
                        switch.hex file listed in Program 6.2. Insert the PIC into the 18-pin
                        socket on the main board. Move the legs by hand so that the limit
                        switches are not triggered, and then turn on the power. The robot
                        should  make  a  start-up  sound  and  then  go  silent.  If  tones  are
                        being produced without the switch being pushed, then turn the
                        power off. Make sure that the polarity of JP2 is correct, with  5


                                                                                                 239
   255   256   257   258   259   260   261   262   263   264   265