Hi Daniel,
This might have to do with the way the AnimatedGifs processes GIF files. In most Arduino sketches, the loop() is called many times per second. In this sketch, when you call processGIFFile()
it doesn’t return until the entire GIF has played. If you have a long GIF, there won’t be a pass through the loop again until the GIF has played, which might make your time updates slower than they should be.
I’m not sure why there are three GIFs playing before the clock updates again. Maybe add an else
after the if (RTC.read(tm)) {
block to see if this is failing every once in a while?
There are some large delays in the clock code e.g. delay(9000);
. You might want to take those out. If you need to throttle the code so something happens every 9 seconds, read millis()
and store it somewhere, then compare to the current time every pass through the loop to see if 9000 milliseconds have elapsed.
Hope that helps.