STORE - BASIC Stamp Command Reference
Value = Idx – 2048 * 2
GOSUB WriteWordToEEPROM
DEBUG "Location: ", DEC5 Idx, " Value: ", DEC5 Value, CR
NEXT
DEBUG "Reading...", CR
PAUSE 2000
FOR Idx = 2048 TO 16383 STEP 32
GOSUB ReadWordFromEEPROM
DEBUG "Location: ", DEC5 Idx, " Value: ", DEC5 Value, CR
NEXT
STOP
' --------------------------- Subroutines ---------------------------
WriteWordToEEPROM:
'NOTE: This routine is written to work only when Idx is an even-byte boundary
STORE Idx >> 11
WRITE Idx, Value.LOWBYTE
WRITE Idx+1, Value.HIGHBYTE
RETURN
ReadWordFromEEPROM:
'NOTE: This routine is written to work only when Idx is an even-byte boundary
STORE Idx >> 11
READ Idx, Value.LOWBYTE
READ Idx+1, Value.HIGHBYTE
RETURN
Page 326 • BASIC Stamp Programming Manual 2.0b • www.parallaxinc.com
'Use different numbers in each location
'Read values from EEPROM
'Set to proper READ/WRITE slot (upper 3-bits of address)
'Set to proper READ/WRITE slot (upper 3-bits of address)
Need help?
Do you have a question about the BASIC Stamp 2e and is the answer not in the manual?