I have a DS3231 module and I need to set an operation at a specific time, for example, Time 11:30. Unfortunately, the DS3231 library is not functional and I am looking for alternative ways to achieve this goal. Can anyone please advise me on how to do this? Thank you .
Example:
When is Time 11:30 Pin 5 Is High (ON).
And when is 11:35 Pin 5 is LOW (OFF)
Use a library that is "functional"? How is the the time set in the RTC? You have to have a valid time set if you are going to check it. Depending on the library and how you are going to use it you may need more than a simple begin().
C:\Users\Hana\AppData\Local\Temp\arduino_modified_sketch_780230\sketch_mar17a.ino: In function 'void setup()':
sketch_mar17a:19:7: error: 'class DS3231' has no member named 'begin'
rtc.begin();
^~~~~
C:\Users\Hana\AppData\Local\Temp\arduino_modified_sketch_780230\sketch_mar17a.ino: In function 'void loop()':
sketch_mar17a:25:11: error: 'class DS3231' has no member named 'getTime'; did you mean 'getA1Time'?
t = rtc.getTime();
^~~~~~~
getA1Time
sketch_mar17a:26:18: error: 'struct tm' has no member named 'hour'; did you mean 'tm_hour'?
Serial.print(t.hour);
^~~~
tm_hour
sketch_mar17a:28:18: error: 'struct tm' has no member named 'min'
Serial.print(t.min);
^~~
sketch_mar17a:33:8: error: 'struct tm' has no member named 'hour'; did you mean 'tm_hour'?
if(t.hour == OnHour && t.min == OnMin){
^~~~
tm_hour
sketch_mar17a:33:28: error: 'struct tm' has no member named 'min'
if(t.hour == OnHour && t.min == OnMin){
^~~
sketch_mar17a:38:15: error: 'struct tm' has no member named 'hour'; did you mean 'tm_hour'?
else if(t.hour == OffHour && t.min == OffMin){
^~~~
tm_hour
sketch_mar17a:38:36: error: 'struct tm' has no member named 'min'
else if(t.hour == OffHour && t.min == OffMin){
^~~
exit status 1
'class DS3231' has no member named 'begin'
the module has registers you can access with I2C protocol.
a read in the datasheet and you can setup your own functions without the need of a library, except maybe the I2C one (usually wire.h).
simple, fancy, home made, with a hint of proud-cuz-u-did-it-yaself.
You are using the wrong library. There are many with similar names.
Post your code, using code tags, and a link to where you downloaded the library.
After downloading an Arduino library, always check its functionality by running one of the library examples. The "standard" DS3231 library available in the library manager does not have a .begin() function.