diff options
| author | mrcodetastic <12006953+mrcodetastic@users.noreply.github.com> | 2024-07-28 23:40:30 +0100 |
|---|---|---|
| committer | mrcodetastic <12006953+mrcodetastic@users.noreply.github.com> | 2024-07-28 23:40:30 +0100 |
| commit | 3960bbed887fc6211ced5abcf8ef00ec4cbd0346 (patch) | |
| tree | 8c9c2a51247a44f5b63f6cf04168a3e3944087ba /examples/AuroraDemo/PatternFire.h | |
| parent | f2634319ab7ebfe22fc6d2ebabcdd27879f3667e (diff) | |
updates
Diffstat (limited to 'examples/AuroraDemo/PatternFire.h')
| -rw-r--r-- | examples/AuroraDemo/PatternFire.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/AuroraDemo/PatternFire.h b/examples/AuroraDemo/PatternFire.h index 731aff9..0f46e2a 100644 --- a/examples/AuroraDemo/PatternFire.h +++ b/examples/AuroraDemo/PatternFire.h @@ -61,26 +61,26 @@ class PatternFire : public Drawable { for (int x = 0; x < VPANEL_W; x++) { // Step 1. Cool down every cell a little for (int y = 0; y < VPANEL_H; y++) { - int xy = XY(x, y); + int xy = XY16(x, y); 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 < VPANEL_H; y++) { - heat[XY(x, y)] = (heat[XY(x, y + 1)] + heat[XY(x, y + 2)] + heat[XY(x, y + 2)]) / 3; + heat[XY16(x, y)] = (heat[XY16(x, y + 1)] + heat[XY16(x, y + 2)] + heat[XY16(x, y + 2)]) / 3; } // Step 2. Randomly ignite new 'sparks' of heat if (random8() < sparking) { // int x = (p[0] + p[1] + p[2]) / 3; - int xy = XY(x, VPANEL_H - 1); + int xy = XY16(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 < VPANEL_H; y++) { - int xy = XY(x, y); + int xy = XY16(x, y); byte colorIndex = heat[xy]; // Recommend that you use values 0-240 rather than |
