test program for RTC8564

Dependencies:   RTC8564 mbed

My simple test program to test the Real Time Clock (RTC) Module bought at Akizuki.

秋月で買ったリアルタイムクロック(RTC)モジュール用のテストプログラムです。

http://akizukidenshi.com/catalog/g/gI-00233/

Files at this revision

API Documentation at this revision

Comitter:
Rhyme
Date:
Fri May 12 01:33:08 2017 +0000
Parent:
1:0905f4f08461
Commit message:
Some clean ups and added title print

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
vt100.lib Show diff for this revision Revisions of this file
--- a/main.cpp	Fri May 12 00:54:59 2017 +0000
+++ b/main.cpp	Fri May 12 01:33:08 2017 +0000
@@ -1,5 +1,4 @@
 #include "mbed.h"
-#include "vt100.h"
 #include "MSS.h"
 #include "RTC8564.h"
 
@@ -16,17 +15,8 @@
     0
 } ;
 
-DigitalOut myled(LED1);
-vt100 *tty = 0 ;
 RTC8564 *rtc = 0 ;
 
-void init_hardware(void)
-{
-    tty = new vt100() ;
-    tty->cls() ;
-    rtc = new RTC8564(PIN_SDA, PIN_SCL, RTC8564_I2C_ADDRESS) ;
-}
-
 void dumpData(uint8_t data[])
 {
     int i ;
@@ -96,18 +86,11 @@
 }
 
 int main() {
-    uint8_t data[16] ;
-    init_hardware() ;
-    rtc->getAll(data) ;
-    dumpData(data) ;
+    rtc = new RTC8564(PIN_SDA, PIN_SCL, RTC8564_I2C_ADDRESS) ;
+    printf("=== test RTC8564 for %s (%s) ===\n",BOARD_NAME, __DATE__) ;
     setTime() ;
     while(1){
- //       rtc->getAll(data) ;
- //       dumpData(data) ;
         printTime() ;
-        myled = 1 ;
-        wait(0.5) ;
-        myled = 0 ;
-        wait(0.5) ;
+        wait(1) ;
     }
 }
--- a/vt100.lib	Fri May 12 00:54:59 2017 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-https://mbed.org/users/Rhyme/code/vt100/#b7229a9eae1c