JonMiles:
Line contains up to 50 strings of no more than 20 character
linetime also contains 50 strings of 20 characters
linetime is a string representation of the time something happened from an rtc module
line is what happened.
I do need to keep them separate though.
That's a monumental waste of resources. You can store any point in time between 1 January 1970 and 19 January 2038 using only 4 bytes. And, that's with 1 second resolution. Google search for "Unix Time".
Also, you should learn about structs so that you can link the "something" with the time that it happens.
gfvalvo:
That's a monumental waste of resources. You can store any point in time between 1 January 1970 and 19 January 2038 using only 4 bytes. And, that's with 1 second resolution. Google search for "Unix Time".
I appreciate that it was a waste of resources, however the library I was using made no reference to unix time, which I routinely use for php, sql etc.
I will look for a library that allows it, as I appreciate its not efficient.
sure - this way you get rid of one component and the time will always be accurate although slower to get (and as long as your internet connexion works).
J-M-L:
sure - this way you get rid of one component and the time will always be accurate although slower to get (and as long as your internet connexion works).
And, you don't need to go out to NTP every time you want to get the current time. Use the Time.h library. It uses millis() to keep time over the short term and you can true-up this value by pulling the current time from NTP every few minutes. That way, the call to get the current time is fast.