-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathled_matrix_worker.h
48 lines (42 loc) · 1.7 KB
/
led_matrix_worker.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
#ifndef LED_MATRIX_WORKER
#define LED_MATRIX_WORKER
#include <Arduino.h>
#include <SPI.h> // include the head file to enable the library.
#include <avr/pgmspace.h>
const int CE = 10; // defined the CE function pin
byte data[4] = {0x0, 0x0, 0x0, 0x0};
const byte BLACK = 0;
const byte RED = 1;
const byte GREEN = 2;
const byte YELLOW = 3;
const byte BLUE = 4;
const byte MAGENTA = 5;
const byte TURQUOISE = 6;
const byte WHITE = 7;
const byte SCREEN_SIZE = 8;
uint8_t screen[8][8] = { //led colors
{0, 1, 1, 0, 0, 0, 0, 0},
{1, 1, 1, 1, 2, 0, 0, 2},
{1, 1, 1, 1, 2, 2, 2, 2},
{1, 4, 4, 1, 2, 2, 2, 2},
{4, 4, 4, 4, 3, 2, 2, 3},
{4, 4, 4, 4, 3, 3, 3, 3},
{4, 0, 0, 4, 3, 3, 3, 3},
{0, 0, 0, 0, 0, 3, 3, 0}
};
byte bufferLong [16] = {0};
const byte scrollDelay = 75;
void swap(uint8_t & a, uint8_t & b);
void reverse(uint8_t * a, uint8_t left, uint8_t right);
void shift_row(uint8_t * a, uint8_t shift);
void shift_col(uint8_t col, uint8_t shift);
void shift_screen(int offset, bool horizont);
void set_pixel(uint8_t x, uint8_t y, uint8_t color);
void set_cursor(uint8_t x,uint8_t y);
void screen_off();
void draw_pixel(uint8_t x, uint8_t y, uint8_t color, bool transparent);
void fill_area(uint8_t x_start, uint8_t y_start, uint8_t x_end, uint8_t y_end, uint8_t color);
void draw_screen();
void scroll_font();
void loadBufferLong(int ascii);
#endif