nein

Dependencies:   Debouncer DigitDisplay Led-libary PCF8563 mbed

Fork of WS_7_Seg_mit_LM1635 by Werkstädte Schmied

Revision:
0:925e9ab5be17
Child:
1:838565907c81
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Apr 20 07:20:09 2016 +0000
@@ -0,0 +1,68 @@
+#include "mbed.h"
+#include "DigitDisplay.h"
+
+DigitDisplay display(p7, p8);
+
+int zahl = 24;  // Schmiedi mach was mit den Tastern, dass man die Zahl einstellen kann
+int sec = 00;
+int t;
+int h;
+int z;
+int e;
+bool colon = true;
+
+
+void berechne()
+{
+    t= zahl/10;
+    h= (zahl-(t*10))/1;
+    z= sec/10;
+    e= (sec-(z*10))/1;
+}
+
+void ausgabemin()
+{
+        display.write(0, t);
+        display.write(1, h);
+        
+}
+
+void ausgabesec()
+{
+        display.write(2, z);
+        display.write(3, e); 
+}
+int main() {
+    
+    while(1) {
+        
+        
+    
+       for( int x = (zahl+1); x > 0; x--)
+       { 
+       for (int y=sec; y > 0; y--)
+       {
+           
+                display.setColon(colon);
+           
+           sec--;
+           berechne();
+           ausgabesec();
+           ausgabemin();
+           wait(1);
+           
+        }
+       
+       zahl--;
+       sec = 60;
+        
+            
+        }
+        
+        display.on();
+        wait(0.5);
+        display.off();
+        wait(0.5);
+      
+    }
+}