Page 218 - The Ultimate Palm Robot
P. 218
Color profile: Generic CMYK printer profile
Composite Default screen
Bots /The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 8
Bots /The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 8
Chapter 8 Taking Control of the BrainStem Robot 201
Programming the BrainStem Using TEA
If you have a PPRK that uses the BrainStem controller, your easiest route to
programming is to use the TEA (Tiny Embedded Applications) language.
TEAis a subset of the C programming language, so if you know C or Java, you
should be able to easily program in TEA.
BrainStem Modes
The BrainStem can actually operate in a number of different modes. These
modes are called Slave mode, Reflex mode, and TEA mode.
In Slave mode, the robot is completely controlled through a host device.
This host device can be a PC or a PDA. The host receives sensor readings from
the BrainStem, performs calculations, and sends servo commands to the
BrainStem. All the computation for controlling the robot occurs on the host,
and the BrainStem module simply acts as a conduit for data and commands.
In Reflex mode, you create a number of small code blocks, called reflexes
and messages, that are stored on the BrainStem controller. Reflexes consist of a
list of references to messages; messages consist of some BrainStem command
that you want to be executed. Events, such as a sensor reading or another reflex,
cause one or more reflexes to be initiated. The reflex causes the commands in
its list to be executed. You can see that these are analogous to the reflexes of
your own body. Tap your knee in the right spot and your lower leg reflexively
reacts. Sneeze and your eyelids close.
Finally, there is TEA mode. This is kind of a mixture of Slave and Reflex
modes. Similar to Reflex mode, you store small programs on the BrainStem
controller. However, unlike Reflex mode, TEA programs don’t execute in
response to events or other TEA programs. Some host must command the
BrainStem controller to execute the TEA programs. However, after the host
has sent the execute command, the BrainStem can be disconnected from the
host and all processing occurs on the BrainStem controller.
We will be looking primarily at TEAmode in this section. Later we will take
a brief look at Reflex mode. The final section in this chapter will look at using
Java in Slave mode.
P:\010Comp\Bots\880-6\ch08.vp
Monday, May 12, 2003 1:16:44 PM