EEPROM is a handy, non-volatile storage space that works well for storing data such as calibration or tuning constants that are not practical to hard-code into Flash.

It is unusual to run out of EEPROM. And it is not often practical to use EEPROM to offload SRAM data. But we'll mention it here for completeness. Using EEPROM requires that you include the EEPROM library.
#include <EEPROM.h>
The EEPROM library gives us 2 functions:

uint8_t read(int)

Read a byte from the specified EEPROM address

void write(int, uint8_t)

Write a byte to the specified EEPROM address

Note that while reads are unlimited, there are a finite number of write cycles (typically about 100,000).

This guide was first published on Aug 02, 2013. It was last updated on Mar 08, 2024.

This page (Using EEPROM) was last updated on Jul 31, 2013.

Text editor powered by tinymce.