About 5-6 years ago I did a project using the above library, since then I have a new computer and today I tried to make some additions to my project. Unfortunately, I cannot find this library to install, the only search result I got that looked like it was the AdaFruit library went to a 404 page.
Has this library been deprecated?- If so, which library replaced it?
Thanks.
Hi @thatotherguy .
Do you remember the name of the library you used?
If yes, what's name.
RV mineirin
@ruilviana The library is "RTC_DS3231" I assume, the header file for it is "rtc_ds3231.h"
@ruilviana Thank you, I have tried the TomOdulate library and it fails to compile. There are many errors, I will see if it has some dependency.
I think that you used the following Library which contained this user defined data type : RTC_DS3231 from which one can create this object: rtc .
RTClib.h
RTClib-master.zip (50.2 KB)
@GolamMostafa That library does not have a header file RTC_3231.h. That look slike the RTCLib library I am already using as well as RTC_DS3231.
See the following sketch.
//#include <Wire.h> //needed for I2c bUS
#include "RTClib.h" //for DS3231 RTC
byte prSec = 0;
RTC_DS3231 rtc; //user data type RTC_DS3231 variable rtc or object
DateTime nowDT;
//char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup ()
{
Serial.begin(115200);
rtc.begin();
rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));
//rtc.adjust(DateTime(2021, 12, 31, 11, 59, 57));//set date-time manualy:yr,mo,dy,hr,mn,sec
}
void loop ()
{
showTime();
timeDelay();//1-sec interval of time display; this time delay comes form DS3231 itself
}
//===================================================
void showTime()
{
nowDT = rtc.now(); //nowDT hold Date and Time
//---------------------------
byte myHour = nowDT.hour(); //myHour holds Hour of time of daya
Serial.print(myHour); //12:58:57 12:4:56
Serial.print(':');
//-------------------------------------------------
byte myMin = nowDT.minute(); //to show leading zero of minute
if (myMin < 10)
{
Serial.print('0');
}
Serial.print(nowDT.minute()); Serial.print(':');
//--------------------------------------------------
byte mySec = nowDT.second();
if (mySec < 10)
{
Serial.print('0');
}
Serial.println(mySec);//(nowDT.second(), DEC);
}
//---------------------------------------------
void timeDelay()
{
prSec = bcdSecond(); //current second of RTC
while (bcdSecond()== prSec)// != 1 )
{
;
}
prSec = bcdSecond(); //delay(1000);
}
byte bcdSecond()
{
nowDT = rtc.now();
if (nowDT.second() == 0 )
{
return 0;
}
else
{
//nowDT = rtc.now();
return nowDT.second();
}
}
I will try rewriting my sketch without the need for the RTC_DS3231.
Thank you @GolamMostafa , @ruilviana
So the mystery is resolved for the RTC_DS3231 library, it appears it was merged into the RTCLib library and a couple of class members were removed. Now my RTC related code compiles.
Hi @thatotherguy ,
please post your sketch, ( use tags </> ), I'm going to my house.
When I get there I run tests with the libraries I have.
RV mineirin
@ruilviana No need to worry more about this. The RTC issue is resolved. Thank you very much.
Are you using RTClib.h Library?
system
Closed
November 15, 2021, 6:25pm
14
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.