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

Amphibionics 04  3/24/03  8:24 AM  Page 107
                                         Chapter 4 / Frogbotic: Build Your Own Robotic Frog
                        :1000D00062280C186B288C1C6F2800006F28080001
                        :1000E0008C098D098C0A03198D0A080083130313E8
                                                                                   Frog-test.hex program
                                                                                   listing (cotinued).
                        :1000F0008312640008008316FF3085000C308600F0                PROGRAM 4.2
                        :100100008312061383160613831286128316861231
                        :1001100083120130A60064000B3026020318B028B9
                        :100120000630A2001030A00050308E0004301420A1
                        :1001300064308E00023014208610831686108312DD
                        :10014000061083160610323083124E208614831652
                        :10015000861083120614831606108312A60F8B28AE
                        :100160000630A2001030A00064308E00043014204D
                        :1001700078308E000230142050308E00023014206F
                        :100180005A308E0002301420861083168610831297
                        :100190000610831606108312AA30A50000218230B3
                        :1001A000A400ED20CC280130A70064001030270205
                        :1001B0000318EC2824088C008D01063084004030A0
                        :1001C000012025088C008D0106308400203001209C
                        :1001D00006304E20A70FD52808000130A800640083
                        :1001E0000B3028020318FF2824088C008D010630EC
                        :1001F00084004030012006304E20A80FEF28080070
                        :100200000130A90064000B302902031812292508C7
                        :100210008C008D01063084002030012006304E20F5
                        :0A022000A90F02290800630013294A
                        :02400E00F53F7C
                        :00000001FF

                        The next experiment will be to read the limit switches, and then
                        turn on the corresponding LED when a limit switch has been acti-
                        vated. Compile the limit-switch.bas program listed in Program 4.3,
                        and then program the PIC 16F84 with the limit-switch.hex listed in
                        Program 4.4. Insert the PIC into the 18-pin socket on the con-
                        troller board and turn on the power. Use your finger to activate the
                        left limit switch. When the switch is activated, the left LED should
                        turn on. If the right LED turns on when the left switch is activat-
                        ed, then switch the pins that the limit switches are attached to on
                        the controller board. Try the same procedure with the right limit
                        switch. If the LEDs do not react when the switches are triggered,
                        then go back and check the wiring.

                                                                                                 107
   123   124   125   126   127   128   129   130   131   132   133