0

Trinket - Neopixel 60 ring wall clock
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Trinket - Neopixel 60 ring wall clock

by gadea on Fri Jan 11, 2019 12:51 pm

Hello; I have built this project but I noticed the clock is slow by 28 minutes.

1) Where does the RTC grab the "now" time from? the computer?
2)I read elswhere in the forums that USB 3 could be a problem, could that be the cause of this issue?
3) If I modify this code:
Code: Select all | TOGGLE FULL SIZE
byte secondval = theTime.second();  // get seconds
byte minuteval = theTime.minute();  // get minutes
int hourval = theTime.hour();   // get hours

to
Code: Select all | TOGGLE FULL SIZE
byte minuteval = theTime.minute() -28;  // get minutes


I will end up having negative values, is there anywhere else I can do a "minus 28 minutes" to workaround this issue?

Thanks

gadea
 
Posts: 1
Joined: Fri Jan 11, 2019 12:26 pm

Re: Trinket - Neopixel 60 ring wall clock

by franklin97355 on Fri Jan 11, 2019 4:35 pm

rtc.now comes from the RTC. The RTC is set with the line
Code: Select all | TOGGLE FULL SIZE
 rtc.adjust(DateTime(__DATE__, __TIME__));
Which sets the RTC to the time the program was compiled. The way I handle this is to create a separate program that runs this line only and run it once to set or reset the RTC. Remove this line from your code so it won't reset the RTC every time you restart the program.

franklin97355
 
Posts: 21076
Joined: Mon Apr 21, 2008 2:33 pm
Location: Lacomb, OR.

Please be positive and constructive with your questions and comments.