Page 107 - The Ultimate Palm Robot
P. 107

Color profile: Generic CMYK printer profile
           Composite  Default screen
                                                      Bots / The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 4






                    90     The Ultimate Palm Robot



                               baud rate is register 9. The n is an integer that can range from 24 (19200 baud)
                               to 200 (2400 baud). The default setting is 50, which sets the baud rate to 9600.
                                  So, the command to set the baud to 9600 is


                               WE9 50

                                 To change the SV203 register, you send this command as a string to the con-
                               troller board. Now, all we need is a simple program to do that. The following
                               program is written for the HotPaw Basic interpreter. The HotPaw interpreter
                               is on the CD-ROM for this book in the \Other Applications directory. If you
                               haven’t yet done so, install HotPaw Basic to your Palm VII. (You can find more
                               information on how to do this in Chapter 7.) Here is the program to change the
                               baud rate of the SV203:


                               #chbaud.bas
                               15 open "com1:", 9600 as #5
                               20 draw -1
                               25 draw "Set SV203 baud rate
                               30 form btn 75,95,70,20, "Send Command ",1
                               35 form fld 80,55,40,12, "50",1
                               40 draw "command value (24 to 200) = ",5,42
                               45 x=asc(input$(1))
                               50 sd$= "WE9 " + s$(0)
                               55 print #5,sd$;
                               60 sound 1800,100,64
                               65 sound 1500,30,64
                               70 close #5 :
                               75 goto 15 : end

                                 In line 15, the program opens a communication channel through COM1, at
                               9600 baud. In lines 25–40, the program draws the form controls.






















           P:\010Comp\Bots\880-6\ch04.vp
           Monday, May 12, 2003 4:03:12 PM
   102   103   104   105   106   107   108   109   110   111   112