Adafruit Led Matrix 64x32 Lib
Dependents: Adafruit-64x32-PWM-Demo
Diff: LedMatrix.h
- Revision:
- 0:cdc5e3a73147
- Child:
- 1:99abd7449a45
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LedMatrix.h Wed Oct 11 00:36:17 2017 +0000 @@ -0,0 +1,36 @@ +#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 \ No newline at end of file