Simple RTC class based on DS1307. Emphasis on simple. Allows you to run at 100k or 400k Hz (for newer DS1307 capable devices). MapTime() allows you to set the time() service to the same as the RTC. Uses struct tm throughout so you can use traditional time functions for manipulation.

Dependents:   AdaFruit_RGBLCD

Revision:
14:d5b47ff12d17
Parent:
13:1ccadbd4c1bd
Child:
15:1645f55bd0ee
--- a/RTclock.cpp	Wed Sep 03 06:22:51 2014 +0000
+++ b/RTclock.cpp	Wed Oct 08 16:41:28 2014 +0000
@@ -127,7 +127,7 @@
             aBuffer[2] = decimalToBcd(nHour) & (m_bTwelveHour ? 0x1f : 0x3f);
             aBuffer[3] = in_sTM.tm_wday;
             aBuffer[4] = decimalToBcd(in_sTM.tm_mday);
-            aBuffer[5] = decimalToBcd(in_sTM.tm_mon) & 0x80 /* 2000+ */;
+            aBuffer[5] = decimalToBcd(in_sTM.tm_mon) & ~0x80 /* 2000+ */;
             aBuffer[6] = decimalToBcd(in_sTM.tm_year + 1900 - 2000);
         
             // Handle the 12hr clock bits