I have a Arduino sketch which was running for about 2 years with no problems.
Due to a hardware failure I have lost the Arduino which had the sketch running.
I have all the libraries necessary to reconstruct the sketch except one.
I have it on file as " ds3231.h " however the ds3231 file I have available shows an error
"aggregate 'ts t' has incomplete type and cannot be defined.
I have reloaded several ds3231 libraries but none work or seem similar to what I had originally.
Does anybody recognise the library from the following sketch code ?
Please post your full sketch, using code tags when you do
Posting your code using code tags prevents parts of it being interpreted as HTML coding and makes it easier to copy for examination
In my experience the easiest way to tidy up the code and add the code tags is as follows
Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.
It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination
Searching on this method, suggests that it may be from ds3231FS - Arduino Reference However, that library is no longer maintained and seems to have disappeared from Github.
Thanks Bob, Had a looksee but its not the one. Originally I had tried a few but the one I eventually chose was so easy to use and east to manually update the time settings.
Tx Anyway
You will need to post the actual code if you want help. We need to see the very specific function calls, constructor, etc, used for the library in order to have any hope of finding it.
Why not just modify the code to use an existing, supported library? You may have the look out for how the days of the week are numbered. Some libraries just use the chip numbering (Sunday = 1), other convert to Unix numbering (Sunday = 0).
Thanks [xfpd]. I tried this but I could not get the Arduino to accept the Zipped file. Seems like there may be something missing from the file but tx anyway
Hi @Farticus. The problem is that this library is not formatted as an Arduino Library.
If you want to give it a try, it can be installed with simple adjustment to the file structure. I didn't look to see whether it is compatible with Arduino, but if you want to give it a try I'll provide instructions you can follow to install that library:
Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open.
Take note of the path shown in the "Sketchbook location" field of the dialog.
Click the "CANCEL" button.
The "Preferences" dialog will close.
Select Download ZIP from the menu.
A download of the ZIP file of the library will start.
Wait for the download to finish.
Extract the downloaded file.
Move the ds3231.h file from the include subfolder of the extracted folder to the root of the extracted folder.
Rename the ds3231.c file that is located the root of the extracted folder to ds3231.cpp. โ This is done because the .c file extension causes the library source code to be compiled as C programming language, while the .ino files of your Arduino sketches are compiled as C++. You can use objects from C libraries in a C++ program, but you need to do something special in your sketch code to accomplish that. So I think it is more simple to just rename the source code file with the .cpp file extension so that it will be compiled as C++ instead of C. C++ is a superset of C, so this shouldn't cause any problems.
Copy the extracted folder to the libraries subfolder of the path you saw in the "Sketchbook location" preference.
The folder structure of the installation must look like this:
Seriously, if you no longer have the code, and are having to rewrite the sketch, then just go with one of the more common, currently supported libraries.
Tx so much ptillisch. That was exactly what I needed. It worked great.
Tx also to the other respondents for the advice and help.
This enquiry can be considered closed.
Thanks all