EEPROM Library

This librariry provides access to internal 360 kB non-volatile EEPROM. Data written to EEPROM is saved even if Z-Uno is not powered. Use it to store data in battery and FLiRS devices that should survive battery unplug. Data written to the EEPROM is saved even if Z-Uno is not powered. Use it to store data that should survive power unplug or sleeping modes.
  • put
  • get
  • read
  • update
  • write

#include "EEPROM.h"

BYTE some_data[] = {0xaa, 0xbb, 0xcc, 0xdd, 0xee}; 
BYTE read_data[5];

void setup() {
  Serial.begin();
}

void loop() {
    byte i;
    word res;
    dword addr = 0x800;
    
    Serial.println("Reading 128 Bytes one by one from EEPROM...");
    for (i = 0; i < 128; i++) {
        Serial.print(EEPROM.read(addr + i),HEX);
        if (((i % 0x10) == 0) && (i != 0))
          Serial.println();
        else
          Serial.print(' ');
    }

    Serial.println();

    Serial.println("Reading buffer from EEPROM...");
    res = EEPROM.get(addr, &read_data, sizeof(read_data));
    Serial.print("Read ");
    Serial.print(res);
    Serial.println(" Bytes");

    // write data to a specific address
    res = EEPROM.put(addr, &some_data, sizeof(some_data));
    
    delay(5000); // don't write to much in the EEPROM not to kill it
}

#include "EEPROM.h"

BYTE some_data[] = {0xaa, 0xbb, 0xcc, 0xdd, 0xee}; 
BYTE read_data[5];

void setup() {
  Serial.begin();
}

void loop() {
    byte i;
    word res;
    dword addr = 0x0;
    
    Serial.println("Reading 128 Bytes one by one from EEPROM...");
    for (i = 0; i < 128; i++) {
        Serial.print(EEPROM.read(addr + i),HEX);
        if (((i % 0x10) == 0) && (i != 0))
          Serial.println();
        else
          Serial.print(' ');
    }

    Serial.println();

    Serial.println("Reading buffer from EEPROM...");
    res = EEPROM.get(addr, &read_data, sizeof(read_data));
    Serial.print("Read ");
    Serial.print(res);
    Serial.println(" Bytes");

    // write data to a specific address
    res = EEPROM.put(addr, &some_data, sizeof(some_data));
    
    delay(5000); // don't write to much in the EEPROM not to kill it
}
User memory layout:
Start addressEnd addressSizeDescription
0x00000x1FFF0xE008 kB3584 BUser memory
0xE000xE044 BSettings of Notification Command Class
0xE040xE084 BSettings of Wakeup Command Class
0x20000xE080x20FF0xE8C256 B132 BUser configuration parameters
0x21000x3FFFF248 kBUser memory
You can also pre-load some data in the EEPROM via USB cable. Check tools section.