Go Down

Topic: using RTC time lib with ds1307 ? (Read 1 time) previous topic - next topic

zachwiej

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

PaulS

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.
The art of getting good answers lies in asking good questions.

zachwiej

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

Go Up