-
Notifications
You must be signed in to change notification settings - Fork 5
/
FlipDot_5x7.h
78 lines (68 loc) · 1.52 KB
/
FlipDot_5x7.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#ifndef FLIPDOT_5X7_H
#define FLIPDOT_5X7_H
#include <Wire.h>
#include <Adafruit_GFX.h>
#define FLIPDOT_BLACK 0
#define FLIPDOT_YELLOW 1
#define FLIPDOT_PULSE_DURATION 500
#define FLIPDOT_I2C_OFFSET 8
#define FLIPDOT_MODULE_WIDTH 5
#define FLIPDOT_MODULE_HEIGHT 7
class FlipDot_5x7 : public Adafruit_GFX {
private:
#ifndef ESP8266
const uint8_t
_dataR = 10,
_dataC = 5,
_en = 6,
_rowA = 9,
_rowB = 8,
_rowC = 7,
_colA = 4,
_colB = 3,
_colC = 2,
_demo = A6;
#endif //ESP8266
uint8_t
_clock,
_data,
_latch;
boolean *imageBuffer = NULL;
boolean *oldImageBuffer = NULL;
boolean _invert;
boolean _serialMode = false;
boolean _rtl = false;
uint8_t _xModules, _yModules,
_pixelDelay = 0;
#ifndef ESP8266
void selectCol(uint8_t);
void selectRow(uint8_t);
#endif //ESP8266
void displayPixel(int16_t, int16_t, boolean);
public:
void begin(void);
void begin(uint8_t, uint8_t, uint8_t);
void drawPixel(int16_t, int16_t, uint16_t);
void display(void);
void setPixelDelay(uint8_t);
void setRtl(boolean);
void invert(boolean);
int16_t width(void) const;
FlipDot_5x7(uint8_t, uint8_t);
FlipDot_5x7(uint8_t, uint8_t, boolean);
};
#ifndef ESP8266
class FlipDot_5x7_Slave : public FlipDot_5x7 {
private:
const uint8_t
addr1 = A0,
addr2 = A1,
addr3 = A2,
addr4 = A3;
public:
FlipDot_5x7_Slave(boolean invert) : FlipDot_5x7(1,1,invert) {}
void begin(void);
void receiveEvent(int);
};
#endif //ESP8266
#endif //FLIPDOT_5X7_H