a

Dependencies:   CheckRTC mbed mbed

Revision:
0:e99d6df2cc36
diff -r 000000000000 -r e99d6df2cc36 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Aug 13 00:21:23 2015 +0000
@@ -0,0 +1,48 @@
+///  Include ---------------------------------------------------------------------------------------
+#include "mbed.h"
+
+#include "CheckRTC.h"
+
+//  Object ----------------------------------------------------------------------------------------
+Serial pc(SERIAL_TX, SERIAL_RX);
+DigitalOut myled1(LED1);                                // Assign LED1 output port
+
+
+
+//  Function prototypes ---------------------------------------------------------------------------
+
+//  Definition ------------------------------------------------------------------------------------
+
+
+//-------------------------------------------------------------------------------------------------
+//  Control Program
+//-------------------------------------------------------------------------------------------------
+
+
+int main()
+{
+     
+    time_t seconds;
+    char buf[64];
+    struct tm t;
+ 
+    t.tm_year       = 15 + 100;
+    t.tm_mon        = 7 - 1;
+    t.tm_mday       = 29;
+    t.tm_hour       = 23;
+    t.tm_min        = 57;
+    t.tm_sec        = 00;
+    seconds = mktime(&t);
+    set_time(seconds);
+    
+   
+    for (;;) {
+        seconds = time(NULL);
+        strftime(buf,40, "%I:%M:%S %p (%Y/%m/%d)", localtime(&seconds));
+        wait(1);
+        myled1 =! myled1;
+        pc.printf("%s\r\n",buf);
+        }
+        
+
+}