I am trying to write and read to a I2C EEPROM AT24C512. In one sketch, if I write then immediately read, there show correct result. But if I use 1 sketch to write data, use another sketch to read data, there show incorrect result.
Is there any library for Arduino to interface with I2C EEPROM?
I used the same idea with the EEPROM.
I have so much data (char set and messages) that it takes 2 sketches to load the data into the EEPROM. Then the data is used by the "real" sketch. Nothing wrong with that idea - it works fine.
However, I think what you are seeing is that the data is never actually getting written to your EEPROM. Instead you are seeing what was put into the buffer from the last write. You can verify this by writing say 1,2,3,4 and then trying to read 1,2,3,4 back. If you can only read 4 back, you are just reading the buffer.