Adafruit Led Matrix 64x32 Lib

Dependents:   Adafruit-64x32-PWM-Demo

Revision:
1:99abd7449a45
Parent:
0:cdc5e3a73147
diff -r cdc5e3a73147 -r 99abd7449a45 LedMatrix.h
--- a/LedMatrix.h	Wed Oct 11 00:36:17 2017 +0000
+++ b/LedMatrix.h	Tue Oct 24 02:59:55 2017 +0000
@@ -7,7 +7,7 @@
 
 #define LOW 0
 #define HIGH 1
-#define PLANES 4
+#define PLANES 5
 #define WIDTH 64
 #define HEIGHT 32
 #define HEIGHT_DEV_2 (HEIGHT / 2)
@@ -15,21 +15,28 @@
 class LedMatrix : public Adafruit_GFX {
 
  private:       
-    void Pset(int16_t x, int16_t y, uint16_t c);
     void WrRow(unsigned char Row);
 
-    unsigned char gm[WIDTH][HEIGHT_DEV_2][PLANES]; 
+    unsigned char gm[2][PLANES][HEIGHT_DEV_2][WIDTH];
     unsigned int plane;
+    unsigned int currRow;
+    unsigned int tickCount;
+    char shownBuffer;
+    char drawBuffer;
+    bool refreshed;
 
  public:
     LedMatrix();
+    void SetDoubleBuffer(bool setDoubleBuffer);
     void Init();
+    void Swap(bool copyBuffer = false);
+    void CopyBuffer(char oldBuffer, char newBuffer);
     uint16_t Color333(uint8_t r, uint8_t g, uint8_t b);
     uint16_t Color444(uint8_t r, uint8_t g, uint8_t b);
     uint16_t Color888(uint8_t r, uint8_t g, uint8_t b);
     uint16_t Color888(uint8_t r, uint8_t g, uint8_t b, bool gflag);
-    uint16_t ColorHSV(long hue, uint8_t sat, uint8_t val, bool gflag);    
-    void drawPixel(int16_t x, int16_t y, uint16_t color);
+    uint16_t ColorHSV(long hue, uint8_t sat, uint8_t val, bool gflag);
+    void drawPixel(int16_t x, int16_t y, uint16_t c);
     void Paint();
 };