Skip to content

weekdayRead()

Arnd edited this page Dec 11, 2020 · 3 revisions

Function returns the value of the MCP7940'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:

...
MCP7940_Class MCP7940;        // Create an instance of the MCP7940
...
  MCP7940.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(MCP7940.weekdayRead());
...