@@ -16,30 +16,26 @@ LedControl ledControls[] = {
16
16
};
17
17
18
18
int main () {
19
- for (int index = 0 ; index < size; index ++) {
20
- ledControls[index ].setIntensity (0 , 15 );
21
- }
22
-
23
19
int version = 1 ;
24
20
uint8_t qrcodeData[qrcode_getBufferSize (version)];
25
- qrcode_initText (&qrcode, qrcodeData, version, ECC_LOW, " HTTPS:// HUBELBAUER.NET" );
21
+ qrcode_initText (&qrcode, qrcodeData, version, ECC_LOW, " HUBELBAUER.NET" );
26
22
27
23
int scale = 2 ;
28
24
int shift = (side - (qrcode.size * scale)) / 2 ;
29
25
for (int y = shift; y < side; y++) {
30
26
for (int x = shift; x < side; x++) {
27
+ int index = y / 8 ;
31
28
int address = size - 1 - (x / 8 );
32
29
int row = y % 8 ;
33
30
int column = 7 - (x % 8 );
34
- bool state = false ; // Turn out of bounds dots off to make sure they don't stay on
31
+
32
+ // Turn out of bounds dots off to make sure they don't stay on
33
+ bool state = false ;
35
34
if (x >= shift && x < shift + (qrcode.size * scale) && y >= shift && y < shift + (qrcode.size * scale)) {
36
35
state = qrcode_getModule (&qrcode, (x - shift) / scale, (y - shift) / scale);
37
36
}
38
37
39
- int index = y / 8 ;
40
- ledControls[index ].shutdown (address, false );
41
38
ledControls[index ].setLed (address, row, column, state);
42
- ledControls[index ].shutdown (address, true );
43
39
}
44
40
}
45
41
}
0 commit comments