Go Down

Topic: Detecting the first run of a chip since being programmed (Read 157 times) previous topic - next topic

wyattgahm

Thought it might be useful for others who also need it...
Code: [Select]

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;
}


Go Up