Skip to content

weekdayRead()

Arnd edited this page Dec 12, 2020 · 2 revisions

Function returns the value of the DS3231M's day-of-week setting as an integer from 1 to 7. The day-of-week value can be set to 1-7 by software. The library will set this when using adjust() to a value representing Monday as 1 and Sunday as to 7. The value can be changed using weekdayWrite() with no effect to the RTC's DateTime value.


Example:

...
DS3231M_Class DS3231M;        // Create an instance of the DS3231M
...
  DS3231M.adjust(DateTime(2017,07,23,12,0,0)); // Set clock to 2017-07-23 12:00:00
  Serial.print("Day of week for 2017-07-23 is ");
  Serial.println(DS3231M.weekdayRead());
...
Clone this wiki locally