-
Notifications
You must be signed in to change notification settings - Fork 0
/
tiny.h
61 lines (44 loc) · 1.24 KB
/
tiny.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
#ifndef __TINY_H__
#define __TINY_H__
#include "defines.h"
class tiny : public animation {
public:
virtual void frame(pixelArray **strip, WII **wii) {
for (int i=0; i<min(PLAYERS,2); i++) {
if (!wii[i]->wiimoteConnected) continue;
if (wii[i]->getButtonClick(ONE)) {
ledstrip[0]->fifoWrite(0x01000000);
ledstrip[1]->fifoWrite(0x01000000);
}
if (wii[i]->getButtonClick(TWO)) {
ledstrip[0]->fifoWrite(0x00010000);
ledstrip[1]->fifoWrite(0x00010000);
}
if (wii[i]->getButtonClick(PLUS)) {
ledstrip[0]->fifoWrite(0x00000100);
ledstrip[1]->fifoWrite(0x00000100);
}
if (wii[i]->getButtonClick(MINUS)) {
ledstrip[0]->fifoWrite(0x00000001);
ledstrip[1]->fifoWrite(0x00000001);
}
if (wii[i]->getButtonClick(UP)) {
ledstrip[0]->fifoWrite(0x80000000);
ledstrip[1]->fifoWrite(0x80000000);
}
if (wii[i]->getButtonClick(DOWN)) {
ledstrip[0]->fifoWrite(0x00800000);
ledstrip[1]->fifoWrite(0x00800000);
}
if (wii[i]->getButtonClick(LEFT)) {
ledstrip[0]->fifoWrite(0x00008000);
ledstrip[1]->fifoWrite(0x00008000);
}
if (wii[i]->getButtonClick(RIGHT)) {
ledstrip[0]->fifoWrite(0x00000080);
ledstrip[1]->fifoWrite(0x00000080);
}
}
}
};
#endif //__TINY_H__