Myndale, it appears as if the EEPROM you programmed doesn't support writing all 1024 bytes. It only supports writing the first 256 bytes. Or, perhaps the EEPROM.read only supports *reading* the first 256 bytes.
- Code: Select all
// Write 0 to 255
for (uint16_t i = 0; i < 256; i++) {
EEPROM.write(i, i);
}
// Read everything.
for (uint16_t i = 0; i < 1024; i++) {
Serial.print(EEPROM.read(i));
Serial.print(", ");
}
It should print 0 to 255, followed by a bunch of 255s (uninitialized EEPROM should be 255). Instead, it prints 0-255 four times. Meaning your simulated EEPROM.read takes an argument of a byte instead of an int16_t or uint16_t.
I ran code on the Gamebuino to confirm the improper behavior of the emulator.
In other news, have you considered open-sourcing it :3