-
Notifications
You must be signed in to change notification settings - Fork 0
/
arduinoPins.h
130 lines (124 loc) · 2.25 KB
/
arduinoPins.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
// LCD Pins
const byte rsPin = 9;
const byte enPin = 8;
const byte d4Pin = 7;
const byte d5Pin = 6;
const byte d6Pin = 3;
const byte d7Pin = 4;
const byte backlightPin = 5;
LiquidCrystal lcd(rsPin, enPin, d4Pin, d5Pin, d6Pin, d7Pin);
// Matrix Pins
const byte dinPin = 12;
const byte clockPin = 11;
const byte loadPin = 10;
LedControl lc = LedControl(dinPin, clockPin, loadPin, 1); //DIN, CLK, LOAD, No. DRIVER
// Joystick Pins
const byte pinSW = 2; // digital pin connected to switch output
const byte pinX = A0; // A0 - analog pin connected to X output
const byte pinY = A1; // A1 - analog pin connected to Y output
// matrix images
const uint8_t IMAGES[][8] = {
// welcome screen 0
{ 0b00011000,
0b00111100,
0b00011000,
0b00111100,
0b01011010,
0b00011000,
0b00100100,
0b00100100 },
// play game 1
{ 0b00111100,
0b01000010,
0b10011001,
0b10010101,
0b10011001,
0b10010001,
0b01000010,
0b00111100 },
// highscore 2
{ 0b10000001,
0b10000001,
0b01000010,
0b00100100,
0b00011000,
0b00100100,
0b00100100,
0b00011000 },
// settings 3
{ 0b01100110,
0b10001111,
0b10100111,
0b01011010,
0b00011000,
0b00100100,
0b01000010,
0b10000001 },
// about 4
{ 0b00011000,
0b00100100,
0b00100100,
0b00000100,
0b00011000,
0b00010000,
0b00000000,
0b00010000 },
// how to play 5
{ 0b01000010,
0b10111101,
0b10000001,
0b10100101,
0b10000001,
0b10011001,
0b10100101,
0b01000010 },
// end game 6
{ 0b00000000,
0b10100101,
0b01000010,
0b10100101,
0b00000000,
0b00011000,
0b00100100,
0b01000010 },
// win game 7
{ 0b01111110,
0b01111110,
0b01111110,
0b00111100,
0b00011000,
0b00011000,
0b00011000,
0b00111100 }
};
enum matrixImages {
WELCOME_SCREEN_IMAGE,
PLAY_GAME_IMAGE,
HIGHSCORE_IMAGE,
SETTINGS_IMAGE,
ABOUT_IMAGE,
HOW_TO_PLAY_IMAGE,
END_GAME_IMAGE,
WIN_GAME_IMAGE
};
uint8_t customChar[][8] = {
// up arrow
{ B00100,
B01110,
B10101,
B00100,
B00100,
B00100,
B00100,
B00100 },
// down arrow
{ B00100,
B00100,
B00100,
B00100,
B00100,
B10101,
B01110,
B00100 }
};
const int buzzerPin = A4;