Page 174 - The Ultimate Palm Robot
P. 174
Color profile: Generic CMYK printer profile
Composite Default screen
Bots /The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 7
Chapter 7 Essential Robot Programming Strategies 157
Programming the PPRK in BASIC
Although the developers of the PPRK used C++ to program their robot, it is
much easier to get started using BASIC. With one version of BASIC that we
will look at, you don’t need to know any of the details of Palm OS program-
ming, such as how to create forms and buttons. Your BASIC program does not
need to be compiled, it exists as a simple text file that is easy for you to edit and
store on the PDA. With many C or C++ systems, you can’t edit the program on
your PDAas you can with a BASIC program. It’s also much easier to bail out of
a badly behaving BASIC program; with C code, a bug in the code could result
in a hard reset for the PDA.
So, have we convinced you to give some BASIC code a try? If so, press on. If
not, we’ll have our “editors” Tony and Guido come over to give you a little
more persuasion.
HotPaw Basic
HotPaw Basic is the work of Ron Nicholson. It is a full-featured BASIC pro-
gramming system that runs on your PDA. Programs are stored as memos in
the MemoPad, and a simple tap of the stylus will run any program. Because
the program is stored as a memo, it is easy to edit the program right on your
PDA. The web site for HotPaw Basic is www.hotpaw.com/hotpaw.
Download HotPaw Basic from the Web or from the CD-ROM and unzip it
onto your hard drive. There are two files that you need to load to the PDA:
ybasic.prc and mathlib.prc. The yBasic application is what runs your BASIC
programs. The file mathlib.prc is a library of double-precision math routines
used by HotPaw Basic.
Find and tap the icon for yBasic in the Applications Launcher.
P:\010Comp\Bots\880-6\ch07.vp
Monday, May 12, 2003 4:29:20 PM