TaChing Yu / Mbed 2 deprecated 4_7SgementLED_74HC595

Dependencies:   mbed

Revision:
1:5002e9577641
Parent:
0:b7855d83d15b
--- a/main.cpp	Sun Sep 04 02:34:07 2016 +0000
+++ b/main.cpp	Sun Sep 04 07:55:21 2016 +0000
@@ -8,7 +8,7 @@
 DigitalOut yy(D13);
 DigitalOut zz(D14);
 
-const int state[10][7]= {
+const int state[10][8]= {
   { 0, 1, 1, 1, 1, 1, 1}, // 0
   { 0, 0, 0, 0, 1, 1, 0}, // 1
   { 1, 0, 1, 1, 0, 1, 1}, // 2
@@ -86,11 +86,16 @@
 }
 int main() 
 {
-    int round=0,round2=0,round3=0,round4=0;
+    int round=0,round2=0,round3=0,round4=0,r=0;;
     while(1) 
     {   
         seg1(round);
-        round++;
+        r++;
+        if (r>=30)
+        {
+            round++;
+            r=0;
+        }
         wait_ms(5);
         seg2(round2);
         wait_ms(5);