I am using a DS3231 RTC module. It requires to set the time every time it is reset. I was wondering if I could read my MacBook's time and date and feed into the module at the setup stage. Is this possible?
P.S. I do not have to use a battery.
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It only takes a minute to sign up.Sign up to join this community
You can use
__TIME__ compiler time constants in IDE and do check inside of your
setup() function if the RTC clock is zeroed then parse and set compile time values.
char cr = __DATE__; char ct = __TIME__;
At the compile time these macros will be replaced with text constants
"Apr 4 2019" and