#define EEPROM_ADDRESS 0x54
#define EEPROM_CAPACITY 8192 // 64Kbit
#define EEPROM_TESTBYTES 16
// write 1 byte EEPROM by address
void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data )
Wire.beginTransmission(deviceaddress);
Wire.write((int)(eeaddress >> 8)); // MSB
Wire.write((int)(eeaddress & 0xFF)); // LSB
// read 1 byte EEPROM by address
byte readEEPROM(int deviceaddress, unsigned int eeaddress )
Wire.beginTransmission(deviceaddress);
Wire.write((int)(eeaddress >> 8)); // MSB
Wire.write((int)(eeaddress & 0xFF)); // LSB
Wire.requestFrom(deviceaddress,1);
Serial.println("EEPROM Testing...");
// write EEPROM from 0 to EEPROM_TESTBYTES
for(int i = 0; i < EEPROM_TESTBYTES; i++){
writeEEPROM(EEPROM_ADDRESS, i, i % 256);
// read from 0 to EEPROM_TESTBYTES
for(int i = 0; i < EEPROM_TESTBYTES; i++){
tmpData = (int)readEEPROM(EEPROM_ADDRESS, i);