24LC256 I2C EEPROM 256kbit

Notes

Example code

void writeEEPROMPage(int deviceaddress, unsigned int eeaddress, int *data ) {
  Wire.beginTransmission(deviceaddress);
  Wire.write((uint8_t)(eeaddress >> 8));    // MSB 
  Wire.write((uint8_t)(eeaddress & 0xFF)); // LSB 
 
  for (int i=0;i<64;i++){
    Wire.write(data[i]);
  }
  Wire.endTransmission();
  delay(10);
}
 
void writeEEPROM(int deviceaddress, unsigned int eeaddress, int data ) 
{
  Wire.beginTransmission(deviceaddress);
  Wire.write((uint8_t)(eeaddress >> 8));    // MSB 
  Wire.write((uint8_t)(eeaddress & 0xFF)); // LSB 
  Wire.write(data);
  Wire.endTransmission();
  delay(10);
}
 
uint8_t readEEPROM(int deviceaddress, unsigned int  eeaddress ) 
{
  uint8_t rdata = 0x00;
 
  Wire.beginTransmission(deviceaddress);
  Wire.write((uint8_t)(eeaddress >> 8));    // MSB 
  Wire.write((uint8_t)(eeaddress & 0xFF)); // LSB 
  Wire.endTransmission();
  Wire.requestFrom(deviceaddress, 1);
 
  while (Wire.available()){
    rdata = Wire.read();
  }
 
  return rdata;
}