Hello,
I am trying to log a timestamp and EventCode (together 4Byte) into EEPROM, that functions properly.
Now i am trying to get the program jump to the last write after reset, to continue from there. Means: After Reset my timestamp should write 0:00:00 and EventCode after the last write before reset.
The problem ist, that after reset it overwrites and logs again from the beginning.
I tried to "write" NULL to my Log Area before starting the program to detect the next NULL "value" and write to that. Below is my program, i hope u can help me.
I am sorry for my english, i hope my problem is understandable
void logMsg(int EventCode) {
bool writeLog = true;
while (writeLog == true) {
if (EEPROM[addr] == NULL) { //Vermeide Überschreiben, falls z.B vorher Stromversorgung unterbrochen wurde
EEPROM.write (addr, hour());
addr++;
EEPROM.write (addr, minute());
addr++;
EEPROM.write (addr, second());
addr++;
EEPROM.write (addr, EventCode);
addr++;
writeLog = false;
}
else {
addr++;
}
}
}
thank you and greetings,
NoobVorformatierter Text