Chat here about code rewrites, mods, etc... with respect to the github project https://github.com/esp8266/Arduino

Moderator: igrr

User avatar
By gmg
#48265 Try this:
Code: Select all#include <EEPROM.h>

void setup()
{
  EEPROM.begin(512);
  Serial.begin(115200);
  pinMode(BUILTIN_LED, OUTPUT);
  // write a 0 to all 512 bytes of the EEPROM
  int i=0;
  int data=0;
  while(i<512){
   EEPROM.put(i, data);
   Serial.println(i);
   delay(50);
   ++i;
  }
  // turn the LED on when we're done
  Serial.println("Done!");
  digitalWrite(BUILTIN_LED, LOW);
  EEPROM.end();
}

void loop()
{
}