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

Amphibionics 06  3/24/03  9:02 AM  Page 247
                                       Chapter 6 / Crocobot: Build Your Own Robotic Crocodile
                                                                                   PROGRAM 6.5
                        '------------------------------------------------------------------------------------------------------------------------------
                        ' walking subroutines
                                                                                   walk-routines.bas
                                                                                   program listing
                        walk_forward:                                              (continued)
                          For temp = 1 to 5
                          ' move left leg
                          high enable_left
                          high forward_left
                          pause 300

                          while limit_left = 0
                          wend

                          low enable_left
                          low forward_left

                          ' move right leg

                          high enable_right
                          high forward_right
                          pause 300

                          while limit_right = 0
                          wend


                          low enable_right
                          low forward_right

                          next temp


                        '------------------------------------------------------------------------------------------------------------------------------

                        turn_left:

                          For temp = 1 to 5


                                                                                                 247
   263   264   265   266   267   268   269   270   271   272   273