-
Notifications
You must be signed in to change notification settings - Fork 0
/
8x8MatrixAnimation.ino
192 lines (172 loc) · 10.9 KB
/
8x8MatrixAnimation.ino
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/*-------------------------------------------
Author : Anuj Mahendra Mutha
Website : https://www.anujmutha.com
LinkedIn : https://www.linkedin.com/in/anujmutha/
Github : https://github.com/AnujMutha
Instagram : https://www.instagram.com/anuj.mutha/
Facebook : https://www.facebook.com/anuj.mutha.31
Twitter : https://twitter.com/anuj_mutha
--------------------------------------------*/
#include "FastLED.h"
#define NUM_LEDS 25
#define DATA_PIN 27//you can change your pin here
CRGB leds[NUM_LEDS];
const long pacmanblue[] PROGMEM ={
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00202040, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x00000000, 0x00000000,
0x00000000, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x00202040, 0x00000000,
0x00202040, 0x00C0C0C0, 0x00000000, 0x0020A0C0, 0x00FFFBF0, 0x00000000, 0x0020A0C0, 0x0020A0C0,
0x0020A0C0, 0x0020A0C0, 0x00FFFBF0, 0x00FFFBF0, 0x0020A0C0, 0x00C0C0C0, 0x00C0C0C0, 0x00202040,
0x00202040, 0x00202040, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0,
0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x0020A0C0, 0x00202040, 0x00202040,
0x00202040, 0x00202040, 0x0020A0C0, 0x00000000, 0x0020A0C0, 0x0020A0C0, 0x00000000, 0x0020A0C0,
};
const long supermario[] PROGMEM ={
0x00000000, 0x00FFFFFF, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00FF0000,
0x00000000, 0x00F9D2A4, 0x00000000, 0x00804000, 0x00F9D2A4, 0x00804000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00804000, 0x00F9D2A4, 0x00F9D2A4, 0x00804000, 0x00804000, 0x00F9D2A4,
0x00000000, 0x00F9D2A4, 0x00F9D2A4, 0x00F9D2A4, 0x00804000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x00FF0000, 0x00FF0000, 0x00FFFF00, 0x000088FF, 0x000088FF, 0x00FF8800, 0x00000000,
0x00808080, 0x00000050, 0x000088FF, 0x000088FF, 0x000088FF, 0x000088FF, 0x00000000, 0x00FFFFFF,
0x00000000, 0x00000000, 0x00804000, 0x00000000, 0x00000000, 0x00000000, 0x00600060, 0x00000000,
};
const long pikachu[] PROGMEM ={
0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00000000, 0x00000000, 0x00FFFFFF,
0x00FFFFFF, 0x00FFFFFF, 0x00FFFF16, 0x00FF6900, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFCF00,
0x00FFD301, 0x00FFED29, 0x00FFE822, 0x00FFFF29, 0x00FFF229, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF,
0x00FFB900, 0x00FFB100, 0x00FFFFFF, 0x00FFFF2A, 0x00000000, 0x00FFFF42, 0x00FFFF42, 0x00000000,
0x00FFCC00, 0x00FFF548, 0x00FFF041, 0x00FFFF49, 0x00EE001B, 0x00FFFFFF, 0x00FFB900, 0x00FFB900,
0x00FFFFFF, 0x00FFB100, 0x00FFFFFF, 0x00FFFF30, 0x00FFB100, 0x00FFBB00, 0x00FFAE00, 0x00FFFFFF,
0x00FFFFFF, 0x00FFF836, 0x00FFC200, 0x00FFFF4A, 0x00FFB100, 0x00FFF32F, 0x00FFAC00, 0x00FFFFFF,
0x00FFFFFF, 0x00FFFFFF, 0x00FFED29, 0x00FFC700, 0x006F4865, 0x006F4E6C, 0x00FFBF00, 0x00FFFFFF,
};
const long pikaball[] PROGMEM ={
0x002196F3, 0x0028B9FF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0028B9FF, 0x002196F3,
0x0028BAFF, 0x00000000, 0x00FF4641, 0x00FF403B, 0x00FF403B, 0x00FF4641, 0x00000000, 0x0028BAFF,
0x00000000, 0x00FF4C46, 0x00E53935, 0x00FE3F3A, 0x00FE3F3A, 0x00E53935, 0x00FF4C46, 0x00000000,
0x00000000, 0x00000000, 0x00FF4A46, 0x00000000, 0x00000000, 0x00FF4A46, 0x00000000, 0x00000000,
0x00000000, 0x00FFFFFF, 0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00000000, 0x00FFFFFF, 0x00000000,
0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00000000, 0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00000000,
0x0028B9FF, 0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00000000, 0x0028B9FF,
0x002196F3, 0x0028B8FF, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0028B8FF, 0x002196F3,
};
const long head[] PROGMEM ={
0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00A06040,
0x00E0A080, 0x00000000, 0x00FFFFFF, 0x00E0A080, 0x00000000, 0x00FFFFFF, 0x00E0A080, 0x00A06040,
0x00E0A080, 0x00FFFFFF, 0x00FFFFFF, 0x00E0A080, 0x00FFFFFF, 0x00FFFFFF, 0x00E0A080, 0x00A06040,
0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080,
0x00E0A080, 0x00E0A080, 0x00000000, 0x00000000, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080,
0x00E0A080, 0x00E0A080, 0x00000000, 0x00000000, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00A06040,
0x00406080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00E0A080, 0x00406080,
};
const long cat[] PROGMEM ={
0x00663AB6, 0x005421AE, 0x006639B6, 0x006639B6, 0x006639B6, 0x005421AE, 0x006639B6, 0x006639B7,
0x005421AE, 0x00FFFFFF, 0x00430BA5, 0x005421AE, 0x00430CA7, 0x00FFFFFF, 0x005523AE, 0x006639B7,
0x005421AE, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x005523AE, 0x006639B7,
0x007240CC, 0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00000000, 0x00723FCB, 0x006639B7,
0x005421AE, 0x00FFFFFF, 0x00FFFFFF, 0x00000000, 0x00FFFFFF, 0x00FFFFFF, 0x00440DA6, 0x005523AE,
0x006639B6, 0x00440CA6, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF, 0x00717171, 0x00FFFFFF, 0x00FFFFFF,
0x006639B7, 0x006639B6, 0x005522AE, 0x004E17B1, 0x00828779, 0x00FFFFFF, 0x00FFFFFF, 0x00FFFFFF,
0x00673AB7, 0x006639B7, 0x006639B6, 0x005522AF, 0x00FFFFFF, 0x0031009E, 0x00FFFFFF, 0x00868686,
};
const long dog[] PROGMEM ={
0x00406080, 0x00406080, 0x00406080, 0x00406080, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
0x00406080, 0x00406080, 0x00406080, 0x00406080, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
0x00406080, 0x00406080, 0x00406080, 0x00406080, 0x00000000, 0x00A06040, 0x00000000, 0x00A06040,
0x00000000, 0x00000000, 0x00000000, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
0x00000000, 0x00000000, 0x00000000, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
0x00000000, 0x00000000, 0x00000000, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00A06040, 0x00A06040, 0x00A06040,
0x00FFFFFF, 0x00A06040, 0x00A06040, 0x00FFFFFF, 0x00A06040, 0x00A06040, 0x00A06040, 0x00A06040,
};
const long crab[] PROGMEM ={
0x00406080, 0x00FFFFFF, 0x00FFFFFF, 0x00406080, 0x00FFFFFF, 0x00FFFFFF, 0x00406080, 0x00406080,
0x00406080, 0x00FFFFFF, 0x00000000, 0x00406080, 0x00FFFFFF, 0x00000000, 0x00406080, 0x00406080,
0x00406080, 0x00FF0000, 0x00406080, 0x00406080, 0x00FF0000, 0x00406080, 0x00406080, 0x00406080,
0x00406080, 0x00FF0000, 0x00406080, 0x00406080, 0x00FF0000, 0x00406080, 0x00406080, 0x00406080,
0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00406080, 0x00FF0000, 0x00FF0000,
0x00FF0000, 0x00FF0000, 0x00000000, 0x00000000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00406080,
0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00FF0000, 0x00406080, 0x00FF0000, 0x00FF0000,
0x00FF0000, 0x00406080, 0x00FF0000, 0x00406080, 0x00FF0000, 0x00406080, 0x00406080, 0x00406080,
};
const long girlface[] PROGMEM ={
0x0083769C, 0x0083769C, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x0083769C,
0x0083769C, 0x00000000, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00000000, 0x00000000, 0x0083769C,
0x0083769C, 0x00000000, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00000000, 0x00000000,
0x0083769C, 0x00000000, 0x00000000, 0x00FFCCAA, 0x00000000, 0x00FFCCAA, 0x00000000, 0x00000000,
0x0083769C, 0x00000000, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00000000,
0x0083769C, 0x00000000, 0x00FFCCAA, 0x00FF77A8, 0x00FFCCAA, 0x00FFCCAA, 0x00000000, 0x0083769C,
0x0083769C, 0x0083769C, 0x00000000, 0x00FFCCAA, 0x00FFCCAA, 0x00000000, 0x00000000, 0x00000000,
0x0083769C, 0x00000000, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00FFCCAA, 0x00000000, 0x00000000,
};
void setup() {
FastLED.addLeds<NEOPIXEL,DATA_PIN>(leds, NUM_LEDS); // Init of the Fastled library
FastLED.setBrightness(80);
}
void loop() {
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(pacmanblue[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(supermario[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(pikachu[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(pikaball[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(head[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(cat[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(dog[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(crab[i]));
}
FastLED.show();
delay(2000);
FastLED.clear();
for(int i = 0; i < NUM_LEDS; i++)
{
leds[i] = pgm_read_dword(&(girlface[i]));
}
FastLED.show();
delay(2000);
}