-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrenderEngine.h
More file actions
45 lines (40 loc) · 1.47 KB
/
Copy pathrenderEngine.h
File metadata and controls
45 lines (40 loc) · 1.47 KB
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
/* Atomic Text - Text scrolling for M5Atom
* Copyright (C) 2020 Silent Software (Benjamin Brown)
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Affero General Public License
* as published by the Free Software Foundation, either version 3
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "WString.h"
#include "stdint.h"
#include <FastLED.h>
const int COLS_PER_CHAR = 6;
const int ROWS_PER_CHAR = 5;
const int PIXELS_PER_CHAR = COLS_PER_CHAR*ROWS_PER_CHAR;
const int ATOM_X_LEDS = 5;
const int ATOM_Y_LEDS = 5;
const int SCROLL_PAUSE = 160;
/**
* Initialise the engine with a scroll pause (in milliseconds) and a palette
*/
void setupEngine(int pause, CRGBPalette16 palette);
/**
* Resets the banner's scroll (window) position
*/
void resetPosition();
/**
* Renders an individual frame (window) of the text at the
* given x "pixel" coordinate.
* @param rowLength the number of columns in the text data
* @param text the message to render
*/
void renderFrame(int rowLength, String text, CRGB rgb);