Can't get DS3231 examples to work

I don't know what it is but I just can't get the examples from the DS3231 master lib to work? I have tried the simple, and others? I get messages like no matching call to DS3231::DS3231()'. These are examples in the library folder?? I am new and trying to fumble my way through but when I can't even get the examples to work, I am stuck.

What board, post your code, schematics, etc.? Please search for and take a look at posting recommendations.

Welcome to the forum

Please post one of the sketches that gives the errors and the full error message, using < CODE/ > tags for both

Which Arduino board are you using ?
How did you install the DS3231 library ?

I[quote="UKHeliBob, post:3, topic:1118057, full:true"]
Welcome to the forum

Please post one of the sketches that gives the errors and the full error message, using < CODE/ > tags for both

Which Arduino board are you using ?
How did you install the DS3231 library ?
[/quote]

I am not sure how to show the code etc. I am using the nano board and believe I uploaded the library, Arduino DS3231 master library from sketches, add library and RTClib from GitHub ( have some success using the examples in the RTClib, library.

Always show us a good schematic of your proposed circuit.
Show us a good image of your ‘actual’ wiring.
Give links to components.


In the Arduino IDE, use Ctrl T or CMD T to format your code then copy the complete sketch.

Use the < CODE / > icon from the ‘posting menu’ to attach the copied sketch.

1 Like

I have gone to sketches and copied the sketch for forum but now sure what to do from here. I used the above code selection but all it does is show the sketch as coded, now the error messages.

/*
  DS3231: Real-Time Clock. Simple example
  Read more: www.jarzebski.pl/arduino/komponenty/zegar-czasu-rzeczywistego-rtc-ds3231.html
  GIT: https://github.com/jarzebski/Arduino-DS3231
  Web: http://www.jarzebski.pl
  (c) 2014 by Korneliusz Jarzebski
*/

#include <Wire.h>
#include <DS3231.h>

DS3231 clock;
RTCDateTime dt;

void setup()
{
  Serial.begin(9600);

  // Initialize DS3231
  Serial.println("Initialize DS3231");;
  clock.begin();

  // Set sketch compiling time
  clock.setDateTime(__DATE__, __TIME__);
}

void loop()
{
  dt = clock.getDateTime();

  // For leading zero look to DS3231_dateformat example

  Serial.print("Raw data: ");
  Serial.print(dt.year);   Serial.print("-");
  Serial.print(dt.month);  Serial.print("-");
  Serial.print(dt.day);    Serial.print(" ");
  Serial.print(dt.hour);   Serial.print(":");
  Serial.print(dt.minute); Serial.print(":");
  Serial.print(dt.second); Serial.println("");

  delay(1000);
}

If you are getting errors about no matching function when compiling the library examples, then you likely have another library using the same header file name, and the compiler is using the wrong library. You will need to find and remove that library.

type or paste code here

Thanks for the information, I will try that. Very confusing for someone just starting. I see a number of projects that say download "x"library but don't say which one to use?? I will consider this to be the solution for now and will come back if that proves not to be the case.
Thank you everyone.

I copied the sketch for the forum under the edit heading and said it was copied to clipboard. When I went to the screen you just showed it wouldn't let me paste it??

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.