Bird Techstep / MAX72XX

Fork of MAX72XX by Bird Techstep

Revision:
3:2bcf4c5b47d4
Parent:
2:8662e8d7d8fa
--- a/MAX72XX.cpp	Mon Aug 04 12:11:51 2014 +0000
+++ b/MAX72XX.cpp	Wed Aug 06 03:14:28 2014 +0000
@@ -1,10 +1,10 @@
 /*****************************************************************************
  * Type : C++
  * File : MAX72XX.cpp
- * Dec. : MAX7219 & MAX7221 Software SPI library
+ * Dec. : MAX7219 & MAX7221 Software SPI library [7 SEGMENT]
  * Copyright (c) 2013-2014, Bird Techstep, tbird_th@hotmail.com
  *
- * Remark Original codr from LedControl Library [Arduino]
+ * Remark : Original codr from LedControl Library [Arduino]
  *
  * Permission is hereby granted, free of charge, to any person obtaining a copy
  * of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,6 @@
  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  * THE SOFTWARE.
  *****************************************************************************/
-#include "mbed.h"
 #include "MAX72XX.h"
 
 #define LOW  0
@@ -75,14 +74,11 @@
     for(int i=0;i<64;i++) 
     status[i] = 0x00;
     for(int i=0;i<maxDevices;i++) {
-        spiTransfer(i,OP_DISPLAYTEST,0);
-        //scanlimit is set to max on startup
-        setScanLimit(i,7);
-        //decode is done in source
-        spiTransfer(i,OP_DECODEMODE,0);
+        spiTransfer(i,OP_DISPLAYTEST,0);    // Display test off on startup
+        setScanLimit(i,7);                  // Scanlimit is set to max on startup
+        spiTransfer(i,OP_DECODEMODE,0);     // Decode-mode is done in source
         clearDisplay(i);
-        //we go into shutdown-mode on startup
-        shutdown(i,true);
+        shutdown(i,true);                   // We go into shutdown-mode on startup
     }
 }
 
@@ -227,8 +223,7 @@
     offset = addr*8;
     index  = value;
     if(index >127) {
-    //no defined beyond index 127, so we use the space char
-    index = 32;
+    index = 32;         //No defined beyond index 127, so we use the space char
     }
     v = charTable[index];
     if(dp)