user13355: I'm trying to clear my EEPROM and am using this code:
#include <EEPROM.h>
void setup()
{
// write a 0 to all 4096 bytes of the EEPROM
for (int i = 0; i < 4096; i++)
EEPROM.write(i, 0);

delay(9999999);
}

void loop()
{
}

I don't see a problem with it but it is ineffective.  Am I missing something?

user20245: The tutorial here is very clear about how to clear the contents of the Atmel's EEPROM.  I only see 2 major difference.  The tutorial finds the size of the EEPROM through a function call.  Probably much safer.  And there is no call to a delay() function.
The tutorial does include lighting up an LED when finished.  And @Edgar Bonet is correct that erasing an EEPROM (altering each floating gate with in the chip) does take time.  And you have no way to known when the EEPROM clearing is finished in your code.  
It is possible you are forcing your code to stop before it is finished.  In which case it would appear the EEPROM is not completely cleared.

13355: <p>I'm trying to clear my EEPROM and am using this code:</p>

<pre><code>#include &lt;EEPROM.h&gt;
void setup()
{
// write a 0 to all 4096 bytes of the EEPROM
for (int i = 0; i &lt; 4096; i++)
EEPROM.write(i, 0);

delay(9999999);
}

void loop()
{
}
</code></pre>

<p>I don't see a problem with it but it is ineffective.  Am I missing something?</p>
 20245: <p>The tutorial <a href="https://www.arduino.cc/en/Tutorial/EEPROMClear" rel="nofollow">here</a> is very clear about how to clear the contents of the Atmel's EEPROM.  I only see 2 major difference.  The tutorial finds the size of the EEPROM through a function call.  Probably much safer.  And there is no call to a delay() function.</p>

<p>The tutorial does include lighting up an LED when finished.  And @Edgar Bonet is correct that erasing an EEPROM (altering each <a href="https://en.wikipedia.org/wiki/Floating-gate_MOSFET" rel="nofollow">floating gate</a> with in the chip) does take time.  And you have no way to known when the EEPROM clearing is finished in your code.  </p>

<p>It is possible you are forcing your code to stop before it is finished.  In which case it would appear the EEPROM is not completely cleared.</p>
