Detecting the first run of a chip since being programmed

This isn't really a question, I just thought it might be useful for others who also need it...

static bool firstRun(){
  for(int i = 0;i<8;i++){
    if(EEPROM.read(i) != (__TIME__)[i]){
      for(int j = i; j < 8;j++) EEPROM.write(j,(__TIME__)[j]);//use EEPROM.update() for better eeprom life
      return true;
    }
  }
  return false;
}

"Not a question" belongs in
Arduino Forum

Community
Exhibition / Gallery

I’ve just something similar to upload some default calibration factors , if it’s a first run - so that any subsequent calibrations changes don’t get over written .

Your sketch is a bit better than mine tho :frowning: