Teensy3.1 USB Serial and RTC test. Use this program to check the operation of the RTC after the 32KHz crystal has been fitted. If a back up cell has also been fitted the RTC will remain running after the main power has been removed. Reconnect the USB to the PC and the RTC time will be displayed when using a PC terminal program.

Dependencies:   USBDevice mbed-src

Fork of USBSerial-RTC-HelloWorld by Community Contributors

Revision:
11:7bf81089fce6
Parent:
10:5a7c14815199
Child:
12:f4e5544977c2
--- a/main.cpp	Sun Jun 14 18:11:07 2015 +0000
+++ b/main.cpp	Mon Jun 15 23:10:36 2015 +0000
@@ -15,7 +15,7 @@
 char timebuff[60];
 
 int minute      =35;    // 0-59
-int hour        =18;    // 2-23
+int hour        =18;    // 0-23
 int dayofmonth  =14;    // 1-31
 int month       =6;     // 1-12
 int year        =15;    // last 2 digits
@@ -27,7 +27,7 @@
             t.tm_hour = (hour);         // 0-23
             t.tm_mday = (dayofmonth);   // 1-31
             t.tm_mon = (month-1);       // 0-11  "0" = Jan, -1 added for Mbed RCT clock format
-            t.tm_year = ((year)+100);   // year since 1900,  current DCF year + 100 + 1900 = correct year
+            t.tm_year = ((year)+100);   // year since 1900,  current year + 100 + 1900 = correct year
             set_time(mktime(&t));       // set RTC clock                
 }  
  
@@ -45,4 +45,3 @@
         led=1;         
     }
 }
- 
\ No newline at end of file