Giter Site home page Giter Site logo

erriez / erriezds3231 Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 7.0 2.94 MB

DS3213 high precision RTC (Real Time Clock) library for Arduino

Home Page: https://github.com/Erriez/ErriezArduinoLibrariesAndSketches

License: MIT License

C++ 100.00%
advanced alarm arduino atmega328 avr date documentation ds3231 epoch esp32 esp8266 examples i2c library rtc terminal time unix uno

erriezds3231's People

Contributors

erriez avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

erriezds3231's Issues

aggregate 'tm dt' has incomplete type and cannot be defined struct tm dt;

C:\Program Files (x86)\Arduino\libraries\ErriezDS3231\src\ErriezDS3231.cpp: In member function 'bool ErriezDS3231::getDateTime(uint8_t*, uint8_t*, uint8_t*, uint8_t*, uint8_t*, uint16_t*, uint8_t*)': C:\Program Files (x86)\Arduino\libraries\ErriezDS3231\src\ErriezDS3231.cpp:398:15: error: aggregate 'tm dt' has incomplete type and cannot be defined struct tm dt;

rtc.getAlarmFlag(Alarm2) output true recurring when it should not

Dear @Erriez , thank you for your library.
I have issue with alarm2. When I check for Alarm2 occurence in a loop, there is activation at a time when it should not activate.
This is the output from my code:
19:08:45.724 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
19:48:45.753 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
21:10:15.649 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
00:21:05.032 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
01:42:35.648 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
03:01:41.943 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
03:25:46.864 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
03:29:18.890 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
04:50:56.583 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
05:16:45.625 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true
10:37:56.892 -> Alarm2 ACTIVE: rtc.getAlarmFlag(Alarm2) == true

after each check that rtc.getAlarmFlag(Alarm2) == true, I disable the alarm:
rtc.clearAlarmFlag(Alarm2);
Can you give some hint about this issue that I am facing?
Thank you.

How to correctly tell if the battery is drained or not?

I have an arduino project with ESP32 and I'm using this library ( which is great btw ).
Currently on power on I'm doing the following

boolean RTC::begin(){
    Wire.begin(rtcSDA_Pin, rtcSCL_Pin);
    Wire.setClock(400000);
    if( !rtc.begin() ){
        Serial.printf("[RTC] - Failed to initialize RTC\n");
        return false;
    }
    Serial.printf("[RTC] - RTC initialized\n");
    checkBattery();
    rtc.clockEnable(true);
    return true;
}

void RTC::checkBattery(){
    Serial.printf("[RTC] - Battery is %s\n", rtc.isRunning()?"charged":"drained");
}

If i call rtc.clockEnable(true); the library will tell me that the battery is ok even if it is drained.
But if i don't set the clock to true it will never be ok, even if i replace the battery.

What is the recommended way of handling the low battery? I want to report to the users that they should replace it even at runtime.
So i would call the check battery function periodically.

Get milliseconds

Hello, You make a good job !
Is it possible to get milliseconds from DS3231 ?
thanks

Time is delayed sometimes when power of the device is off

i am using rtc DS3231 module and your library with esp32- WROOM in my project .... Sometimes, when the power gets cutoff, the time gets delayed from few minutes to hours... Now the main issue is when i to test myself and turn off the device , the time is not changed...Means this behaviour is random, sometimes it does delay sometimes not..... I changed the batteries of rtc module still the issue is there....Please give some solution to this ... THank you in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.