I am trying to use the internal RTC in Arduino Uno R4.
Uno R4 has an internal RTC and Arduino provides a library for that.
A few questions arose while using the library.
Here's a snippet of code from an example sketch:
// Set the initial time if RTC is not running
if (!RTC.isRunning()) {
RTC.setTime(mytime);
}
My question is...
Does the RTC work if I just set the time when the RTC is not running?
Of course, this assumes that mytime is in appropriate format.
Another question is...
There is no function to stop the RTC in the RTC library.
The RTC is configured as running during the startup ?
There is no way to stop the RTC with Arduino function or library except manipulating low level api code?
I've been messing around with the internal RTC on ArduinoUno R4 too, and I totally get your questions.
So, about setting the time when the RTC isn't running – yeah, it does work. I've done it in my projects, and as long as your mytime is in the right format, you're good to go. The check if (!RTC.isRunning()) just ensures that if the RTC isn't ticking, you set the time. It's a neat way to handle it.
As for stopping the RTC, it's a bit tricky. I've noticed the same thing – there's no direct function in the library to stop it. I've dived into the low-level API a bit, but honestly, it seems like you might need to tweak some of the underlying code to achieve that. A bit inconvenient, right?
If you find any better workaround or figure out some cool hack, let me know. Always up for learning some new tricks with Arduino! Cheers!
Please, post your sketch with which I will add needed codes to present the time of the day on a MAX7219 driven 6-digit 7-segment display unit as HRS MIN SEC.