BASIC stamp manual v2.2

5: BASIC Stamp Command Reference – EEPROM
BASIC Stamp Syntax and Reference Manual 2.2 www.parallax.com Page 183
EEPROM
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
EEPROM { Location, } ( DataItem {, DataItem…} )
(See DATA)
Function
Write data to the EEPROM during program download.
Location is an optional variable/constant (0 – 255) that specifies the
starting location in the EEPROM at which data should be stored. If
no location is given, data is written starting at the next available
location.
DataItem is a constant (0 – 255) to be stored in EEPROM.
Quick Facts
Table 5.21: EEPROM Quick
Facts.
BS1
Special Notes
Writes values to EEPROM during download.
Can be used to decrease program size.
Related
Commands
READ and WRITE
Explanation
When you download a program into the BASIC Stamp 1, it is stored in the
EEPROM starting at the highest address (255) and working towards the
lowest address. Most programs dont use the entire EEPROM, so the
lower portion is available for other uses. The EEPROM directive allows
you to define a set of data to store in the available EEPROM locations. It is
called a “directive” rather than a “command” because it performs an
activity at compile-time rather than at run-time (i.e.: the EEPROM
directive is not downloaded to the BASIC Stamp 1, but the data it contains
is downloaded).
The simplest form of the EEPROM directive is something like the
following:
EEPROM (100, 200, 52, 45)
This example, when downloaded, will cause the values 100, 200, 52 and 45
to be written to EEPROM locations 0, 1, 2 and 3, respectively. You can
then use the READ and WRITE commands in your code to access these
locations and the data you’ve stored there.
WRITING SIMPLE, SEQUENTIAL DATA.
1
All
2