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

Amphibionics 06  3/24/03  9:02 AM  Page 253
                                       Chapter 6 / Crocobot: Build Your Own Robotic Crocodile
                        '------------------------------------------------------------------------------------------------------------------------------
                        '  Name     : receive-test.bas
                                                                                   receive-test.bas
                                                                                   program listing
                        '  Compiler : PicBasic Pro - MicroEngineering Labs         PROGRAM 6.7
                        '  Notes     : Program to test the wireless data link
                        '                : between the Lynx 433LC series
                        '                : transmitter and receiver.
                        '------------------------------------------------------------------------------------------------------------------------------
                        ' PortA set as outputs. pins 0 and 1 inputs
                        trisa = %00000011
                        ' PortB set as outputs. pin 0 input.
                        trisb = %00000001

                        '------------------------------------------------------------------------------------------------------------------------------
                        ' initialize variables

                        include "modedefs.bas"

                        rx_baud        CON N2400
                        rxmit             VAR PORTB.0
                        piezo            VAR PORTA.3
                        control          VAR BYTE

                        SOUND PIEZO,[115,10,50,10]

                        start:


                        serin rxmit,rx_baud,["Z"],control

                        if control = "A" then
                          SOUND PIEZO,[115,10,80,20]
                          pause 100
                        endif

                        goto start

                        end


                                                                                                 253
   269   270   271   272   273   274   275   276   277   278   279