I have some simple questions about EEProm's. I use them in my arduino to save some parameters. I also use some i2c eeproms. And i wonder why i can only store values from 0-255 ?
Is there a way to store some full int values like the unix ticks 1255556437 ?
So maybe you can give me a hint ?
Function to write a value into an 24c04a EEprom:
void i2c_eeprom_write_byte( int deviceaddress, int eeaddress, byte data ) {
int rdata = data;
Wire.beginTransmission(deviceaddress);
Wire.send(eeaddress);
Wire.send(rdata);
Wire.endTransmission();
}
All computer memory nowadays is addressed in bytes (8 bits). Even the ram and flash inside the arduino is addressed in bytes they are the fundamental building block of computers. If you want to store bit patterns that can represent numbers larger than 255 you have to use more than one byte to do this.
Cissy high level languages like C do this for you, but real men know this is just an illusion.