Page 213 - The Ultimate Palm Robot
P. 213

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






                     196    The Ultimate Palm Robot



                               calls the doJig( ) function when sensor 1 detects an object. When you click the
                               Stop button, the program closes the serial port using the serclose( ) function.

                               Loading and Running SimpleJig.c
                               Start by creating the program as a memo on your Palm OS device. Alternately,
                               you can create it as a memo in the Palm Desktop or a note in Outlook, and per-
                               form a hot sync operation to load the memo to the PDA.
                                 After you have created the memo, launch PocketC on the PDA. Tap the
                               Compile button to go to the compile screen. You will see a list of memos that
                               contain programs. Select the SimpleJig.c program and tap the Compile button
                               to compile the program. If the program has an error, PocketC will display a di-
                               alog box telling you which line has a problem. When the program successfully
                               compiles, PocketC will automatically return to the main screen.

                                 Connect the PDA to the robot and turn on the robot. Select the SimpleJig
                               program in the main PocketC screen and tap the Execute button to run the pro-
                               gram. Put the robot on the floor and place an object in front of sensor 1. When
                               the sensor detects the object, it will display the range reading on the screen. If
                               the object is close enough, the robot will perform its jig. When you’ve seen
                               enough, tap the Stop button to stop the program. Go back to the PocketC main
                               screen, select SimpleJig, and tap the Output button. This will show you the de-
                               bug output from the puts( ) function calls.



                                 The Robot Geek Says
                                         All of the software tools for creating, programming, and running
                                      programs can be found on the CD-ROM for this book. They are all
                                      demo or trial versions of the software. If you want to purchase the full
                                      version of any package, or you want to search for the latest versions and
                                      other information, you should go to the web sites of these products:
                                   ✖  HotPaw Basic   www.hotpaw.com/hotpaw
                                   ✖  MathLib   www.radiks.net/~rhuebner/mathlib.html
                                   ✖  NS Basic   www.nsbasic.com/palm
                                   ✖  PocketC   www.orbworks.com/pcpalm
                                   ✖  PocketPPRK    home.townisp.com/~kmcentire/palm/pprk/pprk.htm
                                   ✖  Pocket Toolbox  www.geocities.com/retro_01775/PToolboxLib.htm










           P:\010Comp\Bots\880-6\ch07.vp
           Monday, May 12, 2003 4:29:29 PM
   208   209   210   211   212   213   214   215   216   217   218