Problem with DS1307 RTC and library [solved]

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?

If the RTC does not Acknowledge the message, it hangs the sequence. Do the SCL & SDA lines have pullup resistors? They are needed for I2C comms.

Are you supposed to put real values in this line?

RTC.adjust(DateTime(__DATE__, __TIME__));

If not, where does the data come from?

CrossRoads: If the RTC does not Acknowledge the message, it hangs the sequence. Do the SCL & SDA lines have pullup resistors? They are needed for I2C comms.

I think so. I have this board and I assume R2 and R3 are the pullup resistors.

CrossRoads: Are you supposed to put real values in this line?

RTC.adjust(DateTime(__DATE__, __TIME__));

If not, where does the data come from?

The code documentation sais the compiler replaces these values. I removed the line from the code and the result is exactly the same, so I don't think it caused the hang-up.

It works now. I am so extremely sorry for wasting your time. It was a wiring problem. But thank you anyway for the quick replies!