aboutsummaryrefslogtreecommitdiff
path: root/examples/AuroraDemo/PatternSpark.h
diff options
context:
space:
mode:
authormrcodetastic <12006953+mrcodetastic@users.noreply.github.com>2024-07-28 22:00:45 +0100
committermrcodetastic <12006953+mrcodetastic@users.noreply.github.com>2024-07-28 22:00:45 +0100
commitf2634319ab7ebfe22fc6d2ebabcdd27879f3667e (patch)
treed8834f64f0dc4349bf34cf29a6831a12063b1435 /examples/AuroraDemo/PatternSpark.h
parentaa28e2a93baaf90083b2d556c0ac80602d9940aa (diff)
Clean-up and fix some examples
Diffstat (limited to 'examples/AuroraDemo/PatternSpark.h')
-rw-r--r--examples/AuroraDemo/PatternSpark.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/AuroraDemo/PatternSpark.h b/examples/AuroraDemo/PatternSpark.h
index 74f3b16..059d97c 100644
--- a/examples/AuroraDemo/PatternSpark.h
+++ b/examples/AuroraDemo/PatternSpark.h
@@ -54,15 +54,15 @@ class PatternSpark : public Drawable {
effects.DimAll(235); effects.ShowFrame();
- for (uint8_t x = 0; x < MATRIX_WIDTH; x++) {
+ for (uint8_t x = 0; x < VPANEL_W; x++) {
// Step 1. Cool down every cell a little
- for (int y = 0; y < MATRIX_HEIGHT; y++) {
+ for (int y = 0; y < VPANEL_H; y++) {
int xy = XY(x, y);
- heat[xy] = qsub8(heat[xy], random8(0, ((cooling * 10) / MATRIX_HEIGHT) + 2));
+ heat[xy] = qsub8(heat[xy], random8(0, ((cooling * 10) / VPANEL_H) + 2));
}
// Step 2. Heat from each cell drifts 'up' and diffuses a little
- for (int y = 0; y < MATRIX_HEIGHT; y++) {
+ for (int y = 0; y < VPANEL_H; y++) {
heat[XY(x, y)] = (heat[XY(x, y + 1)] + heat[XY(x, y + 2)] + heat[XY(x, y + 2)]) / 3;
}
@@ -70,12 +70,12 @@ class PatternSpark : public Drawable {
if (random8() < sparking) {
uint8_t xt = random8(MATRIX_CENTRE_X - 2, MATRIX_CENTER_X + 3);
- int xy = XY(xt, MATRIX_HEIGHT - 1);
+ int xy = XY(xt, VPANEL_H - 1);
heat[xy] = qadd8(heat[xy], random8(160, 255));
}
// Step 4. Map from heat cells to LED colors
- for (int y = 0; y < MATRIX_HEIGHT; y++) {
+ for (int y = 0; y < VPANEL_H; y++) {
int xy = XY(x, y);
byte colorIndex = heat[xy];