-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplugin_Scramble.cpp
More file actions
executable file
·63 lines (51 loc) · 912 Bytes
/
Copy pathplugin_Scramble.cpp
File metadata and controls
executable file
·63 lines (51 loc) · 912 Bytes
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
/**
* Scramble.cpp
* LEDs zufällig leuchten lassen
*
* @mc Arduino/RBBB
* @autor Andreas Muttscheller / Benedikt Gerlich
* @version 1.0
* @datum 18.3.2011
*/
#include "plugin_Scramble.h"
#include "DisplayMatrix.h"
int Scramble_matrixX;
int Scramble_matrixY;
int count;
// Initialisierung
void initScramble(int x, int y)
{
Scramble_matrixX = x;
Scramble_matrixY = y;
count = 0;
return;
}
// Update
void updateScramble(int timeDiff)
{
count += timeDiff;
return;
}
// Anzeigefunktion
void showScramble()
{
// nur alle 1 sek updaten
if (count < 1000)
{
writeMatrix();
return;
}
clearMatrix();
count = 0;
byte matrixSize = getMatrixSize();
for (int i = 0; i < matrixSize; i++)
{
setMatrix(i, random(65536));
}
// Die Matrix auf die LEDs multiplexen
writeMatrix();
return;
}
void buttonScramble(Button btn, byte id)
{
}