Paint.h
 1  // SPDX-FileCopyrightText: 2019 Anne Barela for Adafruit Industries
 2  //
 3  // SPDX-License-Identifier: MIT
 4  
 5  #include "Arduino.h"
 6  
 7  // display size information
 8  #define X_MIN  0
 9  #define X_MAX  7
10  #define Y_MIN  0
11  #define Y_MAX 15
12  
13  class Paint{
14    private:
15      // cursor coordinates
16      uint8_t cursorX;
17      uint8_t cursorY;  
18      // cursor visibility and flash control
19      bool cursorVisible;
20      uint8_t flashDisableCounter;
21      uint8_t canvas[16];
22      uint8_t activeCanvas[16];
23      
24      void turnOnCursor();
25      void turnOffCursor();
26      bool readCanvas(uint8_t x, uint8_t y);
27      
28    public: 
29      Paint(int8_t x, int8_t y);
30      void flashCursor();                    // flash changes the visiblity (bool cursorVisible) of the cursor by calling turnOnCursor and turnOffCursor
31      void moveCursor(int8_t dx, int8_t dy);
32      void clearCanvas();
33      void draw();
34      
35      uint8_t* getActiveCanvas();
36  };