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

Amphibionics 06  3/24/03  9:02 AM  Page 258
                                                       Amphibionics
                                          then outputting the values to an LCD display. You can check the
                                          program listing for the values. Feel free to make any changes or
                                          improvements. By using a serial wireless data link, the options are
                                          unlimited, so have fun with it.
                                          '------------------------------------------------------------------------------------------------------------------------------
                      PROGRAM 6.11
                      rx-remote.bas program  '  Name       : rx-remote.bas
                      listing             '  Compiler   : PicBasic Pro - MicroEngineering Labs
                                          '  Notes       : Robot remote control using the Linx
                                          '                 : 433LC series transmitter and receiver.
                                          '------------------------------------------------------------------------------------------------------------------------------


                                          ' PortA set as outputs
                                          trisa = %00000000

                                          ' PortB set as outputs. pin 0 input.
                                          trisb = %00000001

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

                                          ' initialize variables

                                          include "modedefs.bas"

                                          rx_baud            CON N2400
                                          rxmit                 VAR PORTB.0
                                          enable_right     VAR PORTB.1
                                          forward_right    VAR PORTB.2
                                          reverse_right    VAR PORTB.3
                                          enable_left       VAR PORTB.4
                                          reverse_left      VAR PORTB.5
                                          forward_left      VAR PORTB.6
                                          limit_left            VAR PORTA.0
                                          limit_right          VAR PORTA.1
                                          piezo                 VAR PORTA.3
                                          control               VAR BYTE
                                          temp                  VAR BYTE



                      258
   274   275   276   277   278   279   280   281   282   283   284