Good Afternoon,
for my project i was thinking to implement external eeprom instead of arduino eeprom because I have at disposition 1.000.000 of write cycle instead of 100.000.
then before to write a post (how ever I've tried to look inside google) and I've found this: topic
http://www.hobbytronics.co.uk/arduino-external-eeprom#include <Wire.h>
#define disk1 0x50 //Address of 24LC256 eeprom chip
void setup(void)
{
Serial.begin(9600);
Wire.begin();
unsigned int address = 0;
writeEEPROM(disk1, address, 123); // eeprom is at the 0x50, add of memory 0 and data 123
Serial.print(readEEPROM(disk1, address), DEC);
}
void loop(){}
void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data )
{
Wire.beginTransmission(deviceaddress);
Wire.write((int)(eeaddress >> 8)); // MSB
Wire.write((int)(eeaddress & 0xFF)); // LSB
Wire.write(data);
Wire.endTransmission();
delay(5);
}
byte readEEPROM(int deviceaddress, unsigned int eeaddress )
{
byte rdata = 0xFF;
Wire.beginTransmission(deviceaddress);
Wire.write((int)(eeaddress >> 8)); // MSB
Wire.write((int)(eeaddress & 0xFF)); // LSB
Wire.endTransmission();
Wire.requestFrom(deviceaddress,1);
if (Wire.available()) rdata = Wire.read();
return rdata;
}
This line of code what are means ?:
Wire.write((int)(eeaddress >> 8)); // What are means ?
Wire.write((int)(eeaddress & 0xFF)); // What are means ?
and this
Wire.write((int)(eeaddress >> 8)); // What are means ?
Wire.write((int)(eeaddress & 0xFF)); // What are means ?
Wire.requestFrom(deviceaddress,1); //What are means ?
Looking the example is not more easy like write and read Arduino Eeprom ... so my question is:
Is there some library that I can use in order to use "external eeprom" easily as "arduino eeprom" ?
Thanks 10000 for support,
Gnux