Robotics with the Boe-Bot text v2.2

Page 152 · Robotics with the Boe-Bot
Now the direction instructions will appear in a more familiar format shown in Figure 4-8.
Instead of ASCII codes, they appear as the actual characters you recorded using the
DATA
directive.
Figure 4-8
Close-up of the
Detailed
EEPROM Map
after Display
ASCII Box is
Checked
This program stored a total of 10 characters in EEPROM. These ten characters were
accessed by the
READ command’s address variable. The address variable was declared
as a byte, so it can access up to 256 locations, well over the 10 we needed. If the
address variable is re-declared to be a word variable, you could theoretically access up
to 65535, far more locations than are available. Keep in mind that if your program gets
larger, the number of available EEPROM addresses for holding data gets smaller.
You can modify the existing data string to a new set of directions. You can also add
additional
DATA statements. The data is stored sequentially, so the first character in the
second data string will get stored immediately after the last character in the first data
string.
Try changing, adding, and deleting characters in the
DATA directive, and re-
running the program. Remember that the last character in the DATA directive
should always be a “Q.”
Modify the DATA directive to make your Boe-Bot perform the familiar forward-
left-right-backward sequence of movements.
Try adding a second
DATA directive. Remember to remove the “Q” from the end
of the first DATA directive and add it to the end of the second. Otherwise, the
program will execute only the commands in the first DATA directive.