-
Notifications
You must be signed in to change notification settings - Fork 7
/
matrixman.h
64 lines (54 loc) · 1.24 KB
/
matrixman.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
#include <inttypes.h>
//Color definitions
#define BLUE 0
#define YELLOW 1
#define RED 2
#define PINK 3
#define ORANGE 4
#define CYAN 5
#define BLACK 6
#define GREY 7
#define WHITE 8
#define LAVENDAR 9
#define GREEN 10
//Color values
static const uint8_t colors[][3] = {
{ 0, 0, 255 }, //Blue
{ 255, 255, 0 }, //Yellow
{ 255, 0, 0 }, //Red
{ 255, 153, 204 }, //Pink
{ 255, 102, 0 }, //Orange
{ 0, 255, 255 }, //Cyan
{ 0, 0, 0 }, //Black
{ 64, 64, 64 }, //Grey
{ 255, 255, 255 }, //White
{ 196, 64, 255}, //Lavendar
{ 0, 255, 0} //Green
};
#ifdef __cplusplus
extern "C"{
#endif
//Directions of travel
#define UP 0
#define DOWN 1
#define LEFT 2
#define RIGHT 3
//Miscellaneous
#define ESCAPE 4
#define NOINPUT 5
#define BUTTON 6
/*---- Display Prototypes ----*/
void initDisplay(void);
void displayClear(uint8_t color);
void displayGameOver(void);
void displayPixel(uint8_t x, uint8_t y, char color);
void displayClose(void);
void displayLatch(void);
/*--------------------*/
/*---- Control Prototypes ----*/
void initControl(void);
uint8_t getControl(void);
void controlDelayMs(uint16_t ms);
#ifdef __cplusplus
} // extern "C"
#endif