I2COUT - BASIC Stamp Command Reference
Page 148
•
BASIC Stamp Programming Manual 2.0b
•
www.parallaxinc.com
DEBUG "Writing...", CR
PAUSE 2000
FOR Idx = 0 TO 2047 STEP 16 'For all 2K locations,
I2COUT 0, $A0+((Idx>>8)*2), Idx, [REP Idx>>4\16] 'Write 16 bytes at once
PAUSE 5
DEBUG "Addr: ", DEC4 Idx, "-", DEC4 Idx+15, " Value: ", DEC3 Idx>>4 & $FF, CR
NEXT
PAUSE 2000
ReadFromEEPROM:
DEBUG CR, "Reading...", CR
PAUSE 2000
FOR Idx = 0 TO 2047 STEP 16 'For all 2K locations,
I2CIN 0, $A1+((Idx>>8)*2), Idx, [STR Result\16] 'Read 16 bytes at once
FOR Check = 0 TO 15 'Check all 16 for
IF Result(Check) <> Idx>>4 & $FF THEN Error 'accuracy, stop if error
NEXT
DEBUG "Addr: ", DEC4 Idx, "-", DEC4 Idx+15, " Value: ", DEC3 Result, CR
NEXT
PAUSE 1000
DEBUG CR, " All Locations PASSED!"
STOP
Error:
DEBUG "Error at location: ", DEC4 Idx+Check, CR
DEBUG "Found: ", DEC3 Result(Check), " Expected: ", DEC3 Idx>>4 & $FF
STOP
Summary of Contents for BASIC Stamp 2e
Page 1: ...BASIC Stamp Programming Manual Version 2 0c...
Page 34: ...Quick Start Guide Page 32 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 340: ...ASCII Chart Page 338 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 342: ...Reserved Words Page 340 BASIC Stamp Programming Manual 2 0b www parallaxinc com...
Page 346: ...Conversion Formatters Page 344 BASIC Stamp Programming Manual 2 0b www parallaxinc com...