example marix 8x8

Dependencies:   MAX7219 mbed

Fork of 00_LAB_matrix8x8_SPI by ferney alberto beltran molina

Revision:
3:4a8de2f71ed0
Parent:
2:414129d953dd
Child:
4:8f0d7520027d
--- a/main.cpp	Thu Mar 16 22:53:10 2017 +0000
+++ b/main.cpp	Thu Mar 16 22:56:47 2017 +0000
@@ -33,9 +33,9 @@
         
     };
 
-void reset_vcol()
+void clr_vcol()
     {
-    for (i=0; i<8;i++){
+    for (int i=0; i<8;i++){
             vcol2[i]=0;
     }
     
@@ -46,18 +46,20 @@
     
     int j, i;
       //reset
-    reset_vcol();
+    
     for (j=0; j<8;j++){
+        clr_vcol();
+        if(j % 2 == 0)
+            vcol2[j]=1;
+        else
+            vcol2[j]=0b10000000;
+    
         for (i=0; i<8;i++){
             if(j % 2 == 0){
-                if (vcol2[j]==0)
-                    vcol2[j]= 1;
-                vcol2[j]=3>>i;
+                 vcol2[j]=3<<i;
                 }
             else{
-                if (vcol2[j]==0x80)
-                    vcol2[j]= 1;
-                vcol2[j]=3>>i;
+                 vcol2[j]=0b1100000000>>i;
                 }
             printMatrix(vcol2);
             wait_ms(5);
@@ -74,7 +76,7 @@
       
     int j, i;
       //reset
-    reset_vcol();
+    clr_vcol();
     for (j=0; j<8;j++){
         for (i=0; i<8;i++){
             if(j % 2 == 0){