Saving integer data after power shutoff

Each cell in the EEPROM is guaranteed to be good for 100,000 erase/write cycles. The cell may work after 100,000 but it is not guaranteed. So to avoid writing to any one cell over the limit we change which cell gets written to so that we can spread the erase/writes over many cells. That is called wear leveling. There is a library that can help, the EEPROMWearLevel Library.

Also the use of the put function will help as it will only write to EEPROM if the data has changed, saving wear by avoiding needless erase/write cycles. The put function uses the update function.