Over the moon!
A couple of days ago, when I opened the initial draft of this message, I had intended for it to be a place to brainstorm and outline what it took to find a working scheduler… but that just changed, when I wrote my own.
As far as how it works, during the void setup (after the time is set), the Colonel looks at the current time and calculates how long until the mins and sec will next read 59:59 (regardless of which hour it is). The timer is then checked at the start of every loop, and when it exceeds the calculated “time until upload”, the current Adata is copied to Xdata, and the Xdata gets uploaded to the spreadsheet.
At the end of the data upload, the length of time until 59:59 is recalculated and saved for the next hour’s upload.
I am completely over the moon with how clean the code ended up for this, after so many headaches looking for a reliable bit of prefab.
The real point of pride for me here though is that this was my first attempt at writing a the scheduler, and not only did it work, it was also stable.
No debugging required!
Now, instead of continuously spamming the spreadsheet 3x per minute, the upload only happens on the hour. I need to mention that it is still popping off 3 times during that hourly upload, but that is because the time to upload counter will reset itself to 0, until the time advances. I should be able to fix this easily by setting a condition that will update any “TimeUntilUpload” results of 0 to 1 hour.
Before I do that however, I think it is worth mentioning that I’ve just hit an elusive milestone, and I’m going to be stopping and enjoying this moment. That scheduler was really the last piece of “heavy lifting” that I needed to work out for the MARLA Operating System upgrade to be considered complete… and having built with my own code, instead of someone else’s, has made this the sweetest victory so far.
That victory also means today is the first official day of ":L Mustard 2.0".
I'm completely over the moon right now!