EEPROM wear levelling

Hi @330R

you did not inform which method you will use to write to the EEPROM.
As they are "int" type variables, I recommend using the EEPROM.put() method to write and the EEPROM.get() method to read.
This method (put) has the advantage of using the EEPROM.update method to record, that is, it only records if the value of each cell is different from what is there.
Then I would record like this:
position X int(2bytes), EEPROM,put(x, myvar);, marker 0xDFDF(2 bytes) EEPROM,put(x, varMarker);, int varEnd = 0xFFFF), EEPROM.put(x+6, varEnd); .
Then you on the next recording look for 0xFFFF and start recording at x - 2, if it is the end of the EEPROM (1024 in the case of the Atmega328), go to the beginning.
This way it would save some recordings and it would not be necessary to reset the entire EEPROM when it was full.
Which would represent one more recording each (1024/4), 256 recordings.

EX:
x = 240
myVar = -250 = 0xFF06
EEPROM 240 = 0XFF, 241 = 0x06, 242 = 0xDE, 243 = 0xDE,
244 = 0x?? , 245 = 0x??, 246 = 0xFF, 247 = 0xFF

Lokking for 0XFFFF ----> 246
x = 246 -2;
next recording:
X = 244
mayVar = 28 = 0x001C
EEPROM 244 = 0x00, 245 = 0x1C, 246 = 0xDE, 247 = 0xDE,
248 = 0x??, 24A = 0x??, 24B = 0xFF, 24C = 0xFF

RV mineirin