Error Problems

Hello
I am asking for some help as this my first attempt with arduino and don't seem to come to an answer with this one that will not compile. I am using a arduino uno compatible. Attached is a copy of my sketch and also the error info.

Thanks a lot Peter

ERROR CODES.txt (2.44 KB)

SKETCH.txt (1.74 KB)

At a quick guess, the DS3231 library you have installed does not match the one the sketch is expecting.

DS3231 rtc(SDA, SCL);

Do you know which DS3231 library you have loaded ?

Apart from anything else you have this line of code

DS3231  rtc(SDA, SCL);

but neither SDA or SCL are declared in the code but the main problem will be the incompatibility of the library with the code

Where did you get the library and the code ?

SDA and SCL are pre-defines on some platforms.

It would be more normal/sensible to use a Wire reference (actual or implicit) in an I2C device, not raw pin numbers like here - is this a very old library / example?

He is using a Uno so a missing declaration of SDA or SCL is not an issue:

However, there is a vast proliferation of incompatible DS3231 "libraries" which cause endless grief for less experienced users.

Edit
@AWOL types quicker than I can

Hi Everybody

Thanks very to you all for your input, this code was 2018 and I have tried DS3231, DS323x and Sadaq_Ds3231 but will now try changing to pin and wire instead as suggested. Again a big thanks for your time to reply.

Peter

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