-
Notifications
You must be signed in to change notification settings - Fork 0
/
pikachu.ino
executable file
·57 lines (57 loc) · 1.65 KB
/
pikachu.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
char playPikachuAnimation() {
// Displays blinking animation
for (int i = 0; i < 7; i++) {
char eventCustomKey = customKeypad.getKey();
if (eventCustomKey) {
screenStateEasterEggShouldPlay = false;
return eventCustomKey;
}
display.clear();
display.display();
display.drawXbm(0, 0, blink_width, blink_height, blink_bits);
delay(200);
display.display();
}
// Displays wild pikachu appeared animation
for (int i = 128; i >= 0; i--) {
char eventCustomKey = customKeypad.getKey();
if (eventCustomKey) {
screenStateEasterEggShouldPlay = false;
return eventCustomKey;
}
display.clear();
display.drawXbm(i, 0, border_width, border_height, border_bits);
display.display();
}
// Holds image for a while
for (int i = 100; i >= 0; i--) {
char eventCustomKey = customKeypad.getKey();
if (eventCustomKey) {
screenStateEasterEggShouldPlay = false;
return eventCustomKey;
}
delay(10);
}
// Displays surprised pikachu
for (int i = 64; i >= 0; i--) {
char eventCustomKey = customKeypad.getKey();
if (eventCustomKey) {
screenStateEasterEggShouldPlay = false;
return eventCustomKey;
}
display.clear();
display.drawXbm(0, i, pikachu_width, pikachu_height, pikachu_bits);
display.display();
}
// Holds image for a while
for (int i = 300; i >= 0; i--) {
char eventCustomKey = customKeypad.getKey();
if (eventCustomKey) {
screenStateEasterEggShouldPlay = false;
return eventCustomKey;
}
delay(10);
}
screenStateEasterEggShouldPlay = false;
return 'e';
}