Data storage with EEPROMs
Until now, we learned and used the Arduino boards as totally electricity dependent devices. Indeed, they need current in order to execute tasks compiled in our firmware.
As we noticed, when we switch them off, every living variable and data is lost. Fortunately, the firmware isn't.
Three native pools of memory on the Arduino boards
The Arduino boards based on the ATmega168 chipset own three different pools of memory:
Flash memory
SRAM
EEPROM
The flash memory is also named program space. This is the place where our firmware is stored.
The SRAM stands for Static Random Access Memory and is the place where the running firmware stores, reads, and manipulates variables.
The EEPROM stands for Electrically Erasable Programmable Read-Only Memory. It is the place where we, programmers, can store things for long-term purposes. This is the place where our firmware sits, and anything in the EEPROM isn't erased should the board be switched off.
ATmega168 has:
16000 bytes of Flash (2000...