Save EEPROM data to permanent storage
mainThe EEPROM library uses a RAM buffer to allow speedy access to data. Changes made via write(), put(), or the subscript operator [] only affect the RAM buffer. To persist these changes to the chip's flash memory, you must call EEPROM.commit().
EEPROM.commit() returns a bool indicating whether the write operation was successful.
EEPROM.write(0, 123);
if (EEPROM.commit()) {
// Data successfully saved to flash
}