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
DS1307 Real Time Clock
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: DS1307 Real Time Clock
There is a link to the library on the tutorial page: http://github.com/adafruit/RTClib
- bigwestwc
- Posts: 9
- Joined: Tue Oct 25, 2011 12:57 pm
Re: DS1307 Real Time Clock
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...adafruit_support wrote:There is a link to the library on the tutorial page: http://github.com/adafruit/RTClib
do you know any way to put the 0's when just reading single digits?
- adafruit_support_bill
- Posts: 88096
- Joined: Sat Feb 07, 2009 10:11 am
Re: DS1307 Real Time Clock
One way is like this:
Or you can format the string using sprintf.
Code: Select all
if(now.hour() < 10)
Serial.print("0");
Serial.print(':'); Serial.print(now.hour(), DEC);
Serial.print(':');
etc,
Please be positive and constructive with your questions and comments.