Skip to content

Commit f789f9e

Browse files
Remove display setup not needed in the simulation
1 parent e69a6dc commit f789f9e

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

wokwi.ino

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,26 @@ LedControl ledControls[] = {
1616
};
1717

1818
int main() {
19-
for (int index = 0; index < size; index++) {
20-
ledControls[index].setIntensity(0, 15);
21-
}
22-
2319
int version = 1;
2420
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");
2622

2723
int scale = 2;
2824
int shift = (side - (qrcode.size * scale)) / 2;
2925
for (int y = shift; y < side; y++) {
3026
for (int x = shift; x < side; x++) {
27+
int index = y / 8;
3128
int address = size - 1 - (x / 8);
3229
int row = y % 8;
3330
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;
3534
if (x >= shift && x < shift + (qrcode.size * scale) && y >= shift && y < shift + (qrcode.size * scale)) {
3635
state = qrcode_getModule(&qrcode, (x - shift) / scale, (y - shift) / scale);
3736
}
3837

39-
int index = y / 8;
40-
ledControls[index].shutdown(address, false);
4138
ledControls[index].setLed(address, row, column, state);
42-
ledControls[index].shutdown(address, true);
4339
}
4440
}
4541
}

0 commit comments

Comments
 (0)