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 I
2C 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:
This file has been truncated.
pins_arduino.h - Pin definition functions for Arduino
Part of Arduino - http://www.arduino.cc/
Copyright (c) 2007 David A. Mellis
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General
Public License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
Boston, MA 02111-1307 USA
However, there is a vast proliferation of incompatible DS3231 "libraries" which cause endless grief for less experienced users.
@AWOL types quicker than I can
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.
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.