5: BASIC Stamp Command Reference - EEPROM
BASIC Stamp Programming Manual 2.0c
•
www.parallaxinc.com
•
Page 111
EEPROM
BS1
BS2 BS2e BS2sx BS2p
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.
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 don’t 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 (ie: 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.
The EEPROM directive uses a counter, called a pointer, to keep track of
available EEPROM addresses. The value of the pointer is initially 0. When
a program is downloaded, the EEPROM directive stores the first byte
value at the current pointer address, then increments (adds 1 to) the
pointer. If the program contains more than one EEPROM directive,
1
2
e
2
sx
2
p
2
W
RITING SIMPLE
,
SEQUENTIAL DATA
.
T
HE
EEPROM
POINTER
(
COUNTER
).
Содержание BASIC Stamp 2e
Страница 1: ...BASIC Stamp Programming Manual Version 2 0c...
Страница 30: ...Introduction to the BASIC Stamps Page 28 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 90: ...BUTTON BASIC Stamp Command Reference Page 88 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 118: ...END BASIC Stamp Command Reference Page 116 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 128: ...FREQOUT BASIC Stamp Command Reference Page 126 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 196: ...NAP BASIC Stamp Command Reference Page 194 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 206: ...OWIN BASIC Stamp Command Reference Page 204 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 214: ...OWOUT BASIC Stamp Command Reference Page 212 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 216: ...PAUSE BASIC Stamp Command Reference Page 214 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 226: ...POLLMODE BASIC Stamp Command Reference Page 224 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 232: ...POLLOUT BASIC Stamp Command Reference Page 230 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 236: ...POLLRUN BASIC Stamp Command Reference Page 234 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 240: ...POLLWAIT BASIC Stamp Command Reference Page 238 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 262: ...RCTIME BASIC Stamp Command Reference Page 260 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 274: ...RUN BASIC Stamp Command Reference Page 272 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 310: ...SEROUT BASIC Stamp Command Reference Page 308 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 324: ...STOP BASIC Stamp Command Reference Page 322 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Страница 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...