Pages: [1]   Go Down
Author Topic: using RTC time lib with ds1307 ?  (Read 1296 times)
0 Members and 1 Guest are viewing this topic.
Katowice POLAND
Offline Offline
Full Member
***
Karma: 2
Posts: 127
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
I'm curious how to properly use Time lib with ds 1307RTC ?
how and when to sync them?
 I know that I must use   setSyncProvider(RTC.get); but when and where?

In setup? If yes - will it synchronize arduino clock(rtc) with ds1307 automatic? or I must sync it manually?

I'm asking because my clock is +60s  than my pc clock after only 20 minutes  :o (I use setSyncProvider(RTC.get) in setup and in loop)



http://www.arduino.cc/playground/Code/Time
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 633
Posts: 50210
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The setSyncProvider function registers a callback to be used when the time needs to be synced. It only needs to be called once, in setup().

Post your code, please.
Logged

Katowice POLAND
Offline Offline
Full Member
***
Karma: 2
Posts: 127
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

today I changed the crystal and it works smiley  Also my pc clock is inaccurate ! I chcecked clock in my phone and there is a big difference
Logged

Pages: [1]   Go Up
Jump to: