aboutsummaryrefslogtreecommitdiff
path: root/examples/AuroraDemo/PatternFire.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/PatternFire.h
parentaa28e2a93baaf90083b2d556c0ac80602d9940aa (diff)
Clean-up and fix some examples
Diffstat (limited to 'examples/AuroraDemo/PatternFire.h')
-rw-r--r--examples/AuroraDemo/PatternFire.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/AuroraDemo/PatternFire.h b/examples/AuroraDemo/PatternFire.h
index 83aa67c..731aff9 100644
--- a/examples/AuroraDemo/PatternFire.h
+++ b/examples/AuroraDemo/PatternFire.h
@@ -58,15 +58,15 @@ class PatternFire : public Drawable {
effects.DimAll(235);
- for (int x = 0; x < MATRIX_WIDTH; x++) {
+ for (int 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;
}
@@ -74,12 +74,12 @@ class PatternFire : public Drawable {
if (random8() < sparking) {
// int x = (p[0] + p[1] + p[2]) / 3;
- int xy = XY(x, MATRIX_HEIGHT - 1);
+ int xy = XY(x, 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];