String Day1_Log = "Logs for day 1: "
String Day2_Log = "Logs for day 2: "
String Day3_Log = "Logs for day 3: "
And a value that accumulates over time the variable is called,
int Power_Value = 1
that power value will increase gradually over time and there are other values like it, one is a max value, another is an on and off.
Given that there are 86400000 in a day I need to append the values upon trigger boolean to the correct day logs.
For example if millis is 8578990 it is day 1 so the value Power_Value = 6 if it was 6 would be appended to Day1_Log = "Logs for day 1: " making it Day1_Log = "Logs for day 1: 8578990, 6, "
If the next time the power value boolean is satisfied as True at 86200000 but this time the Power_Value was 10, the same would happen and it would be "Logs for day 1: 8578990, 6, " changing to "Logs for day 1: 8578990, 6, 86200000, 10, "
In the above case there would have been two values added to the Day1 log string.
As with the examples before if the next time it happens the millis value is 89400000 it would be Day2 so the output would move on from day1 to append to day 2, if this time the Power_Value was still 10 that would be fine and the appended variable would be Day2_Log = "Logs for day 2: 89400000, 10, "
Sorry for the long winded explanation, I understand the boolean for basic if, then but not how to use an antecedent IF that leads to a condition about which variable to append something to.
this is a little hard to follow, but, are you saying
that you need to deal with days from milliseconds?
then..
int days = millis / 8640...000
if(days == 1)
append to log 1
else if (days == 2)
append to log 2
//add 1 if day zero isn't a thing for you..!
which is done by
filename += std::to_string(days);
where filename is a string of what log file to open, eg 1,2,3,...10000,...
and similar logic, eg if you want to keep writing to an open file.. compare newfilename and currentfilename if it is different, close old and open new, if not, keep writing...
I don't have any volatile memory, am tring to run TinyML, BTLE comms, and find a way to appending to logs but only by adjusting variables. Not usual protocol but it's a small microcontroller and doesn't even have a real time function.
Backup battery and multiple chances available! Lol