BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – WRITE
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 459
WRITE
BS1 BS2 BS2e BS2sx BS2p BS2pe BS2px
WRITE Location, Value
WRITE Location, { WORD } Value {, { WORD } Value... }
Function
Write Value into Location in EEPROM.
• Location is a variable/constant/expression (0 – 255 on BS1, 0 – 2047
on all BS2 models) that specifies the EEPROM address to write to.
• Value is a variable/constant/expression (0 – 255, or 0 – 65535 if
using the optional WORD modifier) to store in the EEPROM.
Quick Facts
Table 5.123: WRITE Quick Facts.
BS1 BS2 BS2e and BS2sx BS2p, BS2pe, BS2px
Range of
EEPROM
Locations
0 to 255 0 to 2047 0 to 2047
0 to 2047
(see notes below)
Maximum
Number of
Writes per
Location
10 million 10 million 100,000 100,000
Special
Notes
n/a n/a
WRITE only works
with current program
slot on
BS2e and BS2sx.
WRITE works with an
y
program slot as set b
y
t
he STORE command.
Related
Commands
READ and
EEPROM
READ and
DATA
READ and DATA
READ, DATA, and
STORE
PBASIC 2.5
Syntax
Options
n/a
Multiple sequential variables may be written to the Scratch
Pad RAM, and the optional WORD modifier may be
specified to store 16-bit values.
Explanation
The EEPROM is used for both program storage (which builds downward
from address 255 on BS1, 2047 on all BS2 models) and data storage (which
builds upward from address 0). The WRITE instruction stores a value to
any EEPROM address. Any location within the EEPROM can be written
to (including your PBASIC program's locations) at run-time. This feature is
mainly used to store long-term data to EEPROM; data stored in EEPROM
is not lost when the power is removed.
NOTE: Expressions are not allowed as
arguments on the BS1.
1
All
2
1
NOTE: Optional arguments
require PBASIC 2.5.