Vježba 7.4

Dependencies:   mbed

Revision:
1:d9a5781cd7ce
Parent:
0:bb76d7021216
--- a/main.cpp	Thu Nov 17 17:35:13 2016 +0000
+++ b/main.cpp	Thu Nov 17 17:49:11 2016 +0000
@@ -1,12 +1,16 @@
 #include "mbed.h"
 BusOut Seg1(p5,p6,p7,p8,p9,p10,p11,p12); // A,B,C,D,E,F,G,DP
+BusOut Seg2(p13,p14,p15,p16,p17,p18,p19,p20);
 char SegConvert(char SegValue); // function prototype
 int main()   // main program
 {
     while (1) { // infinite loop
-        for (char i=0; i<10; i++) {
-            Seg1=SegConvert(i);
-            wait(0.2);
+        for (char j=0; j<10; j++) { // counter loop 1
+            Seg2=SegConvert(j); // tens column
+            for (char i=0; i<10; i++) { // counter loop 2
+                Seg1=SegConvert(i); // units column
+                wait(0.2);
+            }
         }
     }
 }