-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathHelloHabr.ino
114 lines (96 loc) · 1.77 KB
/
HelloHabr.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
#include "MatrixCascade.h"
// pin 11 is connected to the DataIn
// pin 13 is connected to the CLK
// pin 10 is connected to LOAD
const uint8_t CascadeSize = 3;
// Software SPI:
//MatrixCascade<CascadeSize> cascade(11, 13, 10);
// Hardware SPI:
MatrixCascade<CascadeSize> cascade(10);
const uint8_t cols[] = {
0b11111111,
0b10000000,
0b10000000,
0b10000000,
0b10000000,
0b11111111,
0b00000000,
0b00111111,
0b00100100,
0b00100100,
0b00011000,
0b00000000,
0b00111111,
0b00000010,
0b00000100,
0b00001000,
0b00111111,
0b00000000,
0b00111111,
0b00101001,
0b00011001,
0b00000110,
0b00000000,
0b00111111,
0b00101001,
0b00101001,
0b00101001,
0b00000000,
0b00100000,
0b00100000,
0b00111111,
0b00100000,
0b00100000,
0b00000000,
0b11000011,
0b01100110,
0b00111100,
0b00111100,
0b01100110,
0b11000011,
0b00000000,
0b00011111,
0b00100100,
0b00100100,
0b00011111,
0b00000000,
0b00111111,
0b00101001,
0b00101001,
0b00100110,
0b00000000,
0b00111111,
0b00100100,
0b00100100,
0b00011000,
0b00000000,
0b00000000,
0b00000000,
0b00000000,
};
const uint8_t colsCount = sizeof(cols);
void setup()
{
cascade.setIntensity(0);
// Rotate some matrixes
cascade[1].setRotation(2);
cascade[2].setRotation(2);
}
const uint8_t matrixSize = 8;
uint8_t offset = 0;
void loop()
{
uint8_t colInd = 0;
for (auto &matrix: cascade)
{
for (auto &col: matrix.cols())
{
matrix.set(col, cols[(offset + colInd)%colsCount]);
colInd++;
delay(3);
}
delay(7);
}
++offset;
offset %= colsCount;
}