Hello people,
I just started working with I2C modules on my Arduino Mega 2560. I connected a DS1307 based RTC module, and run the example code from Overview | DS1307 Real Time Clock Breakout Board Kit | Adafruit Learning System. Now it seems the program hangs in the setup() already.
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
void setup () {
Serial.begin(9600);
Serial.println("Starting up...");
Wire.begin();
Serial.println("Wire initialized");
RTC.begin();
Serial.println("Starting RTC");
RTC.adjust(DateTime(__DATE__, __TIME__));
if (! RTC.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
//
}
Serial.println("Setup complete");
}
For debug reasons I inserted several messages to the serial monitor, but the program never reaches the "Setup complete" message. It does print "Starting RTC", so I guess it hangs on RTC.adjust or RTC.isrunning.
Can you help me with this issue please?