Datasheet

Page 44ยท Applied Robotics with the SumoBot
EEPROM stands for Electrically Erasable Reprogrammable Read Only Memory.
EEPROM memory is nonvolatile. That means, you can store a value in EEPROM,
disconnect power, then reconnect power, and the values you stored will still be there.
Compile-time vs. Run-time - DATA directives are processed when the BASIC Stamp Editor
compiles the program. In other words, DATA directives are processed at compile-time. The
WRITE command can change the values in EEPROM while the program is running. That's
why WRITE commands are said to be run-time commands.
Example Program - SymbolNamesVsAddressContents.bs2
This example program helps demonstrate the distinction between the DATA directive
Symbol names in and the actual data that gets stored in EEPROM bytes.
โˆš Review SymbolNamesVsAddressContents.bs2, and predict what it's going to
display before you run the program.
โˆš Enter, save, and run SymbolNamesVsAddressContents.bs2
โˆš Compare the output in the Debug Terminal to your predictions, and reconcile
any differences.
' Applied Robotics with the SumoBot - SymbolNamesVsAddressContents.bs2
' {$STAMP BS2}
' {$PBASIC 2.5}
Numbers DATA 7, 20, 11, 2, 80
RunStatus DATA 0
UndefData DATA (20)
Alphabet DATA "ABCDEFG"
temp VAR Word
counter VAR Byte
DEBUG "Address of Numbers..........", DEC Numbers, CR
DEBUG "Value stored at Numbers....."
READ Numbers, temp
DEBUG DEC temp, CR
DEBUG "Value at (Numbers + 1)....."
READ Numbers + 1, temp
DEBUG DEC temp, CR, CR
DEBUG "Address of RunStatus........", DEC RunStatus, CR
DEBUG "Value stored at RunStatus..."