I have verified that the battery voltage is reaching the DS1307 chip, and that 5v is being input into the breakout board from the Arduino. The pins are also plugged into the correct positions. I also just retouched up all my solder connections, just to make sure that it wasn't related to a bad joint.
If I run this code, nothing is output onto my serial console:
Code: Select all
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
void setup () {
Serial.begin(57600);
Wire.begin();
RTC.begin();
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
//RTC.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop () {
DateTime now = RTC.now();
Serial.print(now.year(), DEC);
Serial.print('/');
Serial.print(now.month(), DEC);
Serial.print('/');
Serial.print(now.day(), DEC);
Serial.print(' ');
Serial.print(now.hour(), DEC);
Serial.print(':');
Serial.print(now.minute(), DEC);
Serial.print(':');
Serial.print(now.second(), DEC);
Serial.println();
delay(1000);
}
I have been able to in certain cases get just one of the 'now' parameters to print, but can only get one to print at a time. If I try to print two, then it will hang.
So, I'm not sure what is happening and am out of ideas. I am using the Arduino IDE 1.0.5 under Gentoo Linux, with gcc avr-4.6.3, binutils avr-2.23.2, and cross-avr/avr-libc-1.8.0. The code compiles fine and loads onto the Arduino, but it just doesn't do anything.
Any help is appreciated!