DS1307 Real Time Clock

For RTC breakouts, etc., use the Other Products from Adafruit forum

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
burchd
 
Posts: 1
Joined: Tue Jan 10, 2012 1:07 am

DS1307 Real Time Clock

Post by burchd »

I have a DS1307 and i was looking for Arduino programming examples for it. I found what there is on the NetDuino, but wondered if there was aything for Arduino?

Thankyou

db

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: DS1307 Real Time Clock

Post by adafruit_support_bill »

There is a link to the library on the tutorial page: http://github.com/adafruit/RTClib

User avatar
bigwestwc
 
Posts: 9
Joined: Tue Oct 25, 2011 12:57 pm

Re: DS1307 Real Time Clock

Post by bigwestwc »

adafruit_support wrote:There is a link to the library on the tutorial page: http://github.com/adafruit/RTClib
I been running the clock now with the sketch, but i have a small problem it reads the time like this 12:6:7 instead of 12:06:07...
do you know any way to put the 0's when just reading single digits?

User avatar
adafruit_support_bill
 
Posts: 88096
Joined: Sat Feb 07, 2009 10:11 am

Re: DS1307 Real Time Clock

Post by adafruit_support_bill »

One way is like this:

Code: Select all

    if(now.hour() < 10)
        Serial.print("0");
    Serial.print(':');    Serial.print(now.hour(), DEC);
    Serial.print(':');
    etc,
Or you can format the string using sprintf.

Locked
Please be positive and constructive with your questions and comments.

Return to “Clock Kits (discontinued)”