Accessing memory

I have looked in the Arduino reference and cannot find a way to write to the FLASH memory so that data can be preserved across power cycling. What is the way to do this?

Use the EEPROM, not the FLASH.

Flash would have to be written page at a time, buffering the whole
page in RAM, EEPROM is byte at a time.

You can, in a bootloader, reprogram the Flash, but not in user space. This
is how the Arduino bootloader stores your sketch.

KeithRB:
Use the EEPROM, not the FLASH.

Great thanks. Are there any high level instructions to do that, like "writeEEPROM()" and "readEEPROM()" ?

akis_t:

KeithRB:
Use the EEPROM, not the FLASH.

Great thanks. Are there any high level instructions to do that, like "writeEEPROM()" and "readEEPROM()" ?

I cannot believe that you did not try LMGTFY - Let Me Google That For You

UKHeliBob:

akis_t:

KeithRB:
Use the EEPROM, not the FLASH.

Great thanks. Are there any high level instructions to do that, like "writeEEPROM()" and "readEEPROM()" ?

I cannot believe that you did not try LMGTFY - Let Me Google That For You

No, I looked at the "Reference" page and there is no mentioning of EEPROM there. Because it is a library, whereas I thought that EEPROM was an integral part of the CPU and so it should be in the main reference section.

But it is all good now :slight_smile: