This project is compatible with various Arduino boards, and the connections are similar. I'm using Arduino Uno, but I've included connection diagrams for both Arduino Uno and Nano. Most Arduino boards share similar pin configurations refer to the provided connection diagrams.
The DS3231 RTC module has a built-in feature to detect power loss, and this is checked using rtc.lostPower(). If power is lost, it indicates that the RTC might have been without power and could have lost its timekeeping information. In such cases, it adjusts the time using the compilation timestamp.
The DS1307 RTC module lacks a direct method to check for power loss. Instead, it uses rtc.isrunning() to determine if the RTC is actively keeping time. If it's not running, it suggests that the RTC may not have power or may have lost its timekeeping ability. In this case, it adjusts the time using the compilation timestamp. If you were to use either code for both RTC modules, there could be issues.
* Using rtc.lostPower() with DS1307 might not work correctly because it doesn't have the lostPower feature.
* Using !rtc.isrunning() with DS3231 might not effectively check for power loss, and you may miss cases where the DS3231 has lost power.
With a foundation in tech and a love for problem-solving, Currently learning Windows app development, building automation with Google Apps Script, and experimenting with new ways to make technology more useful.
๐ ๏ธ From simple productivity tools to efficient desktop utilities, I enjoy crafting solutions that just work.
๐ Open source is my playground โ I believe in sharing knowledge and collaborating to create better tech for everyone.
๐ Always learning, always improving โ because great software is built on curiosity and persistence.
|