All tutorials

5 · Communication & data

Remember after power-off (EEPROM)

Advanced20 min

Goal

Keep a setting even after a restart.

Why it matters

RAM is wiped at power-off: EEPROM keeps user settings.

Steps

  1. 01Include <EEPROM.h>.
  2. 02Read the stored value at start-up.
  3. 03Write with EEPROM.update() (writes only when the value changes).
  4. 04Print the restored value.

This tutorial runs inside the Circuitly simulator: your wiring and your code are checked automatically at every step.

Next tutorials