Dependencies:   DigitDisplay PCF8563 mbed

Files at this revision

API Documentation at this revision

Comitter:
ladner
Date:
Fri Apr 01 13:15:13 2016 +0000
Commit message:
Uhr-chip auf Anzeige

Changed in this revision

DigitDisplay.lib Show annotated file Show diff for this revision Revisions of this file
PCF8563.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DigitDisplay.lib	Fri Apr 01 13:15:13 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/seeed/code/DigitDisplay/#d3173c8bfd48
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PCF8563.lib	Fri Apr 01 13:15:13 2016 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/teams/Ladner-Schmied/code/PCF8563/#d7f120bcedd7
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Apr 01 13:15:13 2016 +0000
@@ -0,0 +1,31 @@
+#include "mbed.h"
+#include "PCF8563.h"
+#include "DigitDisplay.h"
+
+DigitDisplay display(p7, p8);
+Serial pc(USBTX, USBRX);
+
+PCF8563 rtc;
+
+uint8_t hour, minute, sec;
+
+int main() {
+    while(1) 
+    {
+        hour = rtc.read(HOURS);
+        minute = rtc.read(MINUTES);
+        sec = rtc.read(SECONDS);
+        /*
+        pc.printf("%x%x:%x%x:%x%x(%x)\n\r",
+                  ((hour >> 4) & 0x03), (hour & 0x0F),
+                  (minute >> 4)- 8, (minute & 0x0F),
+                  (sec >> 4)- 8, (sec & 0x0F),sec );
+        */
+        display.write(0, (minute >> 4)- 8);
+        display.write(1, (minute & 0x0F));
+        //display.setColon(1);
+        display.write(2, (sec >> 4)- 8);
+        display.write(3, (sec & 0x0F));
+
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Apr 01 13:15:13 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/87f2f5183dfb
\ No newline at end of file