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:
12:9e7a91c34083
Parent:
11:49b987f6ae26
Child:
13:1ccadbd4c1bd
--- a/RTclock.cpp	Tue Sep 02 08:11:26 2014 +0000
+++ b/RTclock.cpp	Wed Sep 03 06:01:13 2014 +0000
@@ -74,7 +74,7 @@
 
 bool RTclock::read(uint8_t in_nAddress, char * out_pBuffer, int in_nLength)
 {
-    if (0 != m_cI2C.write(0xd0, (char *)&in_nAddress, size_t(in_nAddress))) return false;
+    if (0 != m_cI2C.write(0xd0, (char *)&in_nAddress, 1)) return false;
     if (0 != m_cI2C.read(0xd0, out_pBuffer, in_nLength)) return false;
     
     return true;