Arduino opta read/write permanent memory

Hi everyone,

I'm trying to convert this snippets to make them work on the Arduino OPTA Lite.

void ee_write(int address, byte val) {
    if (address > EE_SIZE) return;
    byte r = EEPROM.read(address);
    if (r != val) EEPROM.write(address, val);
}

byte ee_read(int address) {
    if (address > EE_SIZE) return 0;
    return EEPROM.read(address);
}

Can you please help me? How can I do it?

Thanks in advance,

Davide

What is you troubles?
Is this code compiles?

The problem is that Arduino Opta doesn't have the eeprom hardware, so the EEPROM.h library (from which the EEPROM.read and EEPROM.write functions are taken) isn't available for the Opta board.

The Arduino Support answered me:

The Arduino Opta shares the same microcontroller as the Portenta H7.

Please take a look at the following tutorial: Reading and Writing Flash Memory.

Now I have the documentation to make the code work, so I can mark it as solved.

Thanks.

1 Like