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.
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
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.