clearEEPROM()

[EEPROM]
void clearEEPROM ();

Description

Clears the EEPROM memory by writing zeros to all addresses.

Parameters

None.

Returns

Nothing.

Example Code

The code initializes the EEPROM with a size of 1024 bytes and a width of 1 byte and clears the EEPROM memory.

void setup() {
    beginEEPROM(1024);  // initializes the EEPROM memory with a size of 1024 bytes and a data width of 1 byte
    clearEEPROM();      // clears the EEPROM memory
}

void loop() {
}

Notes and Warnings

  • The clearEEPROM() function can only be used after the beginEEPROM() function.
  • The clearEEPROM() function can be called multiple times to clear the EEPROM memory, even inside the loop.