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.

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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy