user38608: I am programming my arduino with the capability to keep time with the DS3231 from Adafruit. I do not have the module yet, but am trying to figure out the rest of the build without it.
However, it seems like the way to determine RTC is working does not work, as it returns true, even without the module.
Example code from the Adafruit RTC library for using this module:
// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include <Wire.h>
#include "RTClib.h"

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif

  Serial.begin(9600);

  delay(3000); // wait for console opening

  if (! rtc.begin()) { // part that fails. begin() returns true when should return false
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, lets set the time!");
    // following line sets the RTC to the date & time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date & time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  } 
}
....


user26916: If you look at the library source code it will be clear why begin() returns true.
From https://github.com/adafruit/RTClib/blob/1.2.0/RTClib.cpp#L434-L437:
boolean RTC_DS3231::begin(void) {
  Wire.begin();
  return true;
}

I suppose they plan to eventually make the return value of begin() mean something but for now it does not.

user76930: This should not happen anymore.
Actually, if you have a look at the last version of the source code on GitHub (1.13.0), you will see that now the developers implemented also a case in which the method returns false.
from https://github.com/adafruit/RTClib/blob/1.13.0/RTClib.cpp#L1537-L1543 :
boolean RTC_DS3231::begin(void) {
  Wire.begin();
  Wire.beginTransmission(DS3231_ADDRESS);
  if (Wire.endTransmission() == 0)
    return true;
  return false;
}


38608: <p>I am programming my arduino with the capability to keep time with the DS3231 from Adafruit. I do not have the module yet, but am trying to figure out the rest of the build without it.</p>

<p>However, it seems like the way to determine RTC is working does not work, as it returns true, even without the module.</p>

<p>Example code from the Adafruit RTC library for using this module:</p>

<pre><code>// Date and time functions using a DS3231 RTC connected via I2C and Wire lib
#include &lt;Wire.h&gt;
#include "RTClib.h"

RTC_DS3231 rtc;

char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};

void setup () {

#ifndef ESP8266
  while (!Serial); // for Leonardo/Micro/Zero
#endif

  Serial.begin(9600);

  delay(3000); // wait for console opening

  if (! rtc.begin()) { // part that fails. begin() returns true when should return false
    Serial.println("Couldn't find RTC");
    while (1);
  }

  if (rtc.lostPower()) {
    Serial.println("RTC lost power, lets set the time!");
    // following line sets the RTC to the date &amp; time this sketch was compiled
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
    // This line sets the RTC with an explicit date &amp; time, for example to set
    // January 21, 2014 at 3am you would call:
    // rtc.adjust(DateTime(2014, 1, 21, 3, 0, 0));
  } 
}
....
</code></pre>
 26916: <p>If you look at the library source code it will be clear why <code>begin()</code> returns true.</p>

<p>From <a href="https://github.com/adafruit/RTClib/blob/1.2.0/RTClib.cpp#L434-L437" rel="nofollow noreferrer">https://github.com/adafruit/RTClib/blob/1.2.0/RTClib.cpp#L434-L437</a>:</p>

<pre class="lang-cpp prettyprint-override"><code>boolean RTC_DS3231::begin(void) {
  Wire.begin();
  return true;
}
</code></pre>

<p>I suppose they plan to eventually make the return value of <code>begin()</code> mean something but for now it does not.</p>
 76930: <p>This should not happen anymore.</p>
<p>Actually, if you have a look at the last version of the source code on GitHub (1.13.0), you will see that now the developers implemented also a case in which the method returns false.</p>
<p>from <a href="https://github.com/adafruit/RTClib/blob/1.13.0/RTClib.cpp#L1537-L1543" rel="nofollow noreferrer">https://github.com/adafruit/RTClib/blob/1.13.0/RTClib.cpp#L1537-L1543</a> :</p>
<pre><code>boolean RTC_DS3231::begin(void) {
  Wire.begin();
  Wire.beginTransmission(DS3231_ADDRESS);
  if (Wire.endTransmission() == 0)
    return true;
  return false;
}
</code></pre>
