DS1307 Real Time Clock

Tick Tock Clock Kits

Moderators: adafruit_support_bill, adafruit

DS1307 Real Time Clock

Postby burchd » Tue Feb 21, 2012 4:51 pm

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
burchd
 
Posts: 1
Joined: Tue Jan 10, 2012 12:07 am


Re: DS1307 Real Time Clock

Postby bigwestwc » Sat Jun 16, 2012 12:58 pm

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?
bigwestwc
 
Posts: 9
Joined: Tue Oct 25, 2011 11:57 am

Re: DS1307 Real Time Clock

Postby adafruit_support_bill » Sat Jun 16, 2012 1:53 pm

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.
User avatar
adafruit_support_bill
 
Posts: 16022
Joined: Sat Feb 07, 2009 9:11 am


Return to Clocks

Who is online

Users browsing this forum: No registered users and 1 guest

Stuff to buy from the Adafruit store and links to product documentation!


New Products [103]

Raspberry Pi[80]
 
FLORA[23]
 
Bunnie Studios[9]
 
FPGA[1]
 
mbed[11]
Arduino[60]
 
NETduino[14]
 
BeagleBone[24]
 
Android[6]
 
XBee[10]
More Dev Boards[30]


 
BoArduino[8]
 
SpokePOV[4]
 
TV-B-Gone[4]
 
MiniPOV[3]
 
SIM reader[3]
 
Microtouch[5]
 
Clocks & Watches[18]
 
Drawdio[4]
 
Brain Machine[1]
 
Game of Life[2]
 
MintyBoost[2]
More DIY Kits[16]


 
MaKey MaKey[3]
 
Tweet-a-Watt[5]
 
Young Engineers[33]
 
Discover Electronics[2]
 
Snap Circuits[4]
 
littleBits[3]
 
Project packs[8]


 
Breakout Boards[33]
LCDs & Displays[48]
Components & Parts[69]
Batteries & Power[49]
EL Wire/Tape/Panel[52]
LEDs[109]
 
Wireless[14]
Cables[61]
 
Lasers[6]
Sensors/Parts[145]
 
Enclosures/Cases[11]
 
Solar[11]
 
RFID / NFC[13]
Prototyping[70]
 
iDevices[13]
Tools[71]
 
Wearables[39]
 
CNC[37]
 
Robotics[29]
 
3D printing[1]
 
Materials[24]


 
Stickers[41]
 
Skill badges[55]
 
Books[25]
 
Circuit Playground[7]
 
Gift Certificates[4]