Page 231 - The Ultimate Palm Robot
P. 231
Color profile: Generic CMYK printer profile
Composite Default screen
Bots / The Ultimate Palm Robot/ Mukhar & Johnson / 222880-6 / Chapter 8
214 The Ultimate Palm Robot
launching the program or programs you are working on. However, once you
have a working program, you may want the program to be launched automat-
ically every time you turn the robot on. With auto-launching, you can take the
robot anywhere and be free from the need to have a host computer to operate
the robot.
After you have steeped and loaded a TEA program onto the BrainStem,
you can instruct the BrainStem to automatically launch that program by issu-
ing two commands. The two commands will set the BrainStem to automati-
cally launch a loaded program the next time that the BrainStem boots up:
❏ cmdVAL_SET
❏ cmdVAL_SAV
These two commands are defined in the BrainStem command reference
files. You can find the reference files on the CD-ROM, or you can access them
at Acroname’s web site. Information on the commands is in the Commands
section of the reference; information on bootstrapping programs is in the
TEAvm section of the reference.
The cmdVAL_SET command is used to set a system variable. In this case,
we will set the variable that tells the BrainStem to auto-launch a program. The
cmdVAL_SAV command saves the variable setting in the EEPROM so it is
available the next time the BrainStem boots up.
When issuing BrainStem commands to the BrainStem, the general syntax is
module_id command_id [parameter [,parameter]]
As we discussed above, the default module ID for BrainStem controllers is
2. The command ID for cmdVAL_SET is 18, and cmdVAL_SAV is 19 (you can
find this in the Commands section of the reference). cmdVAL_SET takes two
parameters: the index of the system variable and a new value for the variable.
You can set up to four boot programs using system variables 15, 16, 17, or 18.
The new value will be the program slot of the program to be launched. So to
set and save a variable to command the program in slot 0 to auto-launch, type
the following two lines into the Console program, pressing Enter after each
line to send each line:
2 18 15 0
2 19
P:\010Comp\Bots\880-6\ch08.vp
Monday, May 12, 2003 1:16:46 PM