Adafruit Led Matrix 64x32 Lib

Dependents:   Adafruit-64x32-PWM-Demo

LedMatrix.h

Committer:
davidr99
Date:
2017-10-11
Revision:
0:cdc5e3a73147
Child:
1:99abd7449a45

File content as of revision 0:cdc5e3a73147:

#include "mbed.h"
#include "Adafruit_GFX.h"
#include "gamma.h"

#ifndef _LED_MATRIX_H
#define _LED_MATRIX_H

#define LOW 0
#define HIGH 1
#define PLANES 4
#define WIDTH 64
#define HEIGHT 32
#define HEIGHT_DEV_2 (HEIGHT / 2)

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 int plane;

 public:
    LedMatrix();
    void Init();
    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);
    void Paint();
};

#endif