Hello, everyone, I am new to Arduino and this is my first project! In the project, I am using Millis() to keep track of time but it isn't so accurate. The timer is 14 seconds too slow every hour. I know that the internal clock of the Arduino isn't exact but I think 14 seconds is too big of an error. I am wondering why this is the case. Is it because my code is long and that's why it doesn't keep track of time properly? I don't have any for or while loops that would block the code. Any help would be appreciated. Thank you!
I attached the code at the bottom, any feedback on that would be very helpful as well.
It is not your code (well at least I trust it is'nt). The millis() function relies on the onboard ceramic resonator that drives the CPU clock on the Arduino. It is not a precision frequency source. It is often significantly slow or fast compared to a quartz crystal resonator and is extremely temperature sensitive.