forked from adafruit/Mini-LED-Gamer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Paint.h
32 lines (27 loc) · 788 Bytes
/
Paint.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
#include "Arduino.h"
// display size information
#define X_MIN 0
#define X_MAX 7
#define Y_MIN 0
#define Y_MAX 15
class Paint{
private:
// cursor coordinates
uint8_t cursorX;
uint8_t cursorY;
// cursor visibility and flash control
bool cursorVisible;
uint8_t flashDisableCounter;
uint8_t canvas[16];
uint8_t activeCanvas[16];
void turnOnCursor();
void turnOffCursor();
bool readCanvas(uint8_t x, uint8_t y);
public:
Paint(int8_t x, int8_t y);
void flashCursor(); // flash changes the visiblity (bool cursorVisible) of the cursor by calling turnOnCursor and turnOffCursor
void moveCursor(int8_t dx, int8_t dy);
void clearCanvas();
void draw();
uint8_t* getActiveCanvas();
};