BASIC stamp manual v2.2
5: BASIC Stamp Command Reference – WRITE
BASIC Stamp Syntax and Reference Manual 2.2 • www.parallax.com • Page 463
Demo Program (WRITE.bs2)
' WRITE.bs2
' This program writes some data to EEPROM and then reads them back out
' and displays the data in the Debug window.
' {$STAMP BS2}
' {$PBASIC 2.5}
idx VAR Byte ' loop control
value VAR Word(3) ' value(s)
Main:
WRITE 0, 100 ' single byte
WRITE 1, Word 1250 ' single word
WRITE 3, 45, 90, Word 725 ' multi-value write
Read_EE:
FOR idx = 0 TO 6 ' show raw bytes in EE
READ idx, value
DEBUG DEC1 idx, " : ", DEC value, CR
NEXT
DEBUG CR
' read values as stored
READ 0, value
DEBUG DEC value, CR
READ 1, Word value
DEBUG DEC value, CR
READ 3, value(0), value(1), Word value(2)
FOR idx = 0 TO 2
DEBUG DEC value(idx), CR
NEXT
END
All
2
NOTE: This example program can be
used with all BS2 models by changing
the $STAMP directive accordingly.