Page 219 - The Ultimate Palm Robot
P. 219
Color profile: Generic CMYK printer profile
Composite Default screen
Bots / The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 8
202 The Ultimate Palm Robot
Installing Acroname Software
To use TEAmode, you will need the Console application and a library of TEA
functions and subroutines, both from Acroname. We’ve included all the files
you need on the CD-ROM for the book. But if you want to make sure you have
the latest and greatest files, you can get them at www.acroname.com. The file
you need is the pprk_sdk.zip or pprk_sdk.sit file. Acroname has created dif-
ferent versions of the software for many different systems. You will need to
download the software for your system (Windows PC, Mac, or Palm OS).
Unpack the file to your hard drive.
In the directory structure that is created when you unpack the pprk_sdk
archive file are the directories aBinary, aSystem, and aUser. The aBinary direc-
tory contains programs that help you use your BrainStem controller. One of
these is a program called Console, which is used to load programs from a host
to the BrainStem. Another program is Config, which allows you to check the
operation of the sensors and servos. The aSystem directory contains the li-
brary files that you can use to create BrainStem programs. The aUser directory
is where you will place your TEA source code.
If you are using a Palm PDA as a host, TEA source code files should be
placed in the MemoPad. You’ll find it much easier to edit the files on a PC, and
then perform a HotSync operation to put the memos on your PDA. You can
edit TEA files on the PDA if you want, but it is a cumbersome process.
Writing TEA Programs
Since TEA is based on C, if you know C (like I know C), you won’t have any
problems at all. The big difference between the two is that TEA does not use
pointers. Another difference between TEAand C is with a right shift operation.
In TEA, a right shift on a signed or unsigned variable will perform an arithmetic
shift. This means the sign bit is always shifted right into the value. In Ansi C, a
right shift on an unsigned variable shifts zeros into the value. Afinal difference
is that although you can include files in your TEA program, as we will see
shortly, you don’t include header files. TEA programs do not use header files
like C or C++; the files that you include are other source files.
The main entry point for all TEA programs is the main( ) function. In this
book, we will be using a form of main( ) that looks like this:
void main()
P:\010Comp\Bots\880-6\ch08.vp
Monday, May 12, 2003 1:16:44 PM