Forum Rule: Always post complete source code & details to reproduce any issue!
-
adjustTime(number) problem when adding seconds
As you can see, I added some test code to the existing example TimeTeensy3. With test set to HIGH you can see that the clock doesn't advance beyond 5 minutes or so.
With test set to LOW the clock advances OKE.
Seems that there is a problem with adjustTime?

>>> Added code <<<<
boolean test=HIGH;
if (test) {
adjustTime(120); // Does not work beyond 5 min. when test=HIGH
} else {
setTime(now()+120); // Works perfect when test=LOW
}
-
I forgot to tell that this is done on a Teensy 3.6.
The example sourcecode is on Github examples/TimeTeensy3/TimeTeensy3.ino
-
Hello,
with adjusttime() you set timelib object but not the RTC on Tennsy 3.x.
In setup() you have set syncronisation of timelib with teensy-RTC by "setSyncProvider(getTeensy3Time)". Default time for sync is 300 seconds (5 minutes). You can change this by "setSyncInterval(seconds)".
So after 5 minutes your before adjusted time in timelib (+120) ist resyncronised with RTC an set with value of RTC.
Bear in mind timelib and RTC are two independent objects.
Of course you can also adjust RTC with "Teensy3Clock.set(t)".
-
Thanks for the great and quick reply.
That explains a lot!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules