Forked LEDMatrix and added horizontal scrolling

Fork of LEDMatrix by Yihui Xiong

Revision:
3:1e06e89bc0c9
Parent:
2:cd2da920cf98
Child:
4:40d4afefcd74
--- a/LEDMatrix.h	Thu Jan 14 12:57:59 2016 +0000
+++ b/LEDMatrix.h	Thu Jan 14 16:52:04 2016 +0000
@@ -26,7 +26,7 @@
 
 const int LED_MATRIX_LEDS_HORIZONTALLY = 32;
 const int LED_MATRIX_LEDS_VERTICALLY = 16;
-const int LED_MATRIX_MAX_LINES = 16;
+const int LED_MATRIX_MAX_LINES = 2;
 
 class LEDMatrix 
 {
@@ -39,7 +39,8 @@
      * @param pDisplayBuf    display buffer
      * @param number        panels' number
      */
-    void begin(uint8_t *pDisplayBuf, uint16_t width, uint16_t height, uint16_t scrollWidth, uint16_t numLines, int charSeparation = 1);
+    void begin(uint8_t *pDisplayBuf, uint16_t width, uint16_t height, uint16_t scrollWidth, 
+        uint16_t numLines, int charSeparation = 1, int flashRate = 8);
 
     /**
      * draw a point - origin is like a graph with 0,0 at the lower-left corner
@@ -90,6 +91,8 @@
     int displayChar(int xPos, int yPos, char ch);
     int displayLargeDigit(int curX, int curY, char ch);
     int displayLine(int lineIdx, const char* line);
+    
+    void setAlert(int lineIdx, bool alertOn);
 
     // Called frequently and regularly to handle effects like scrolling
     void serviceEffects();
@@ -109,6 +112,11 @@
     bool _isBusy;
     int _charSeparation;
     int _lineScrollInc[LED_MATRIX_MAX_LINES];
+    bool _lineAlert[LED_MATRIX_MAX_LINES];
+    bool _lineInvert[LED_MATRIX_MAX_LINES];
+    int _flashCounter;
+    int _flashRate;
+    bool _flashState;
 };
 
 #endif