I am trying to save an int to the EEPROM. This is a calibration number which I am hoping to read on any future power-ups.
From what I gathered, it is not possible to write an into to one EEPROM address. Is there a way that I can split this int into two bytes and save in two addresses?
Note: The int is generated from analogRead() of a pin.
Depending on the precision you need, I often divide ints to fit into a byte then write the byte to eeprom. Go the other way to retrieve data from eeprom. Just a thought.
From what I gathered, it is not possible to write an into to one EEPROM address. Is there a way that I can split this int into two bytes and save in two addresses?
The EERPOM library can read and write int's. You provide the starting address for where you want to store/read the data. It will automatically use two EEPROM bytes to store the int.