diff --git a/package-lock.json b/package-lock.json index 4d94a501..b2c88292 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "wled", - "version": "0.14.0-b1.16", + "version": "0.14.0-b7.17", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "wled", - "version": "0.14.0-b1.16", + "version": "0.14.0-b7.17", "license": "ISC", "dependencies": { "clean-css": "^4.2.3", diff --git a/package.json b/package.json index 932bfaa9..80211316 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "wled", - "version": "0.14.0-b1.16", + "version": "0.14.0-b7.17", "description": "Tools for WLED project", "main": "tools/cdata.js", "directories": { diff --git a/platformio.ini b/platformio.ini index 10822e36..2b1f709d 100644 --- a/platformio.ini +++ b/platformio.ini @@ -661,7 +661,7 @@ build_flags_all = -D USERMOD_BH1750 -D USERMOD_ANIMATED_STAIRCASE -D USERMOD_RTC ;; experimental - ; -D USERMOD_SENSORSTOMQTT ;; experimental ewpwi causes error: fatal error: Adafruit_Sensor.h: No such file or directory + ; -D USERMOD_SENSORSTOMQTT ;; experimental ewowi causes error: fatal error: Adafruit_Sensor.h: No such file or directory -D USERMOD_ANALOG_CLOCK -D USERMOD_MULTI_RELAY -D USERMOD_PIRSWITCH @@ -672,6 +672,7 @@ build_flags_all = -D USERMOD_BME280 -D USERMOD_DHT -D USERMOD_VL53L0X_GESTURES + -D WLED_ENABLE_PIXART lib_deps_all = claws/BH1750 @^1.2.0 ; used for USERMOD_BH1750 diff --git a/wled00/FX.cpp b/wled00/FX.cpp index c29207f6..cdaabb83 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -1964,41 +1964,41 @@ static const char _data_FX_MODE_PALETTE[] PROGMEM = "Palette@Cycle speed;;!;;c3= // feel of your fire: COOLING (used in step 1 above) (Speed = COOLING), and SPARKING (used // in step 3 above) (Effect Intensity = Sparking). uint16_t mode_fire_2012() { - uint16_t strips = SEGMENT.nrOfVStrips(); + const uint16_t strips = SEGMENT.nrOfVStrips(); if (!SEGENV.allocateData(strips * SEGLEN)) return mode_static(); //allocation failed byte* heat = SEGENV.data; - uint32_t it = strip.now >> 5; //div 32 + const uint32_t it = strip.now >> 6; //div 64 struct virtualStrip { static void runStrip(uint16_t stripNr, byte* heat, uint32_t it) { + const uint8_t ignition = max(3,SEGLEN/10); // ignition area: 10% of segment length or minimum 3 pixels + + // Step 1. Cool down every cell a little + for (int i = 0; i < SEGLEN; i++) { + uint8_t cool = (it != SEGENV.step) ? random8((((20 + SEGMENT.speed/3) * 16) / SEGLEN)+2) : random(8); + uint8_t minTemp = 0; + if (i 1; k--) { heat[k] = (heat[k - 1] + (heat[k - 2]<<1) ) / 3; // heat[k-2] multiplied by 2 } + } - // Step 3. Randomly ignite new 'sparks' of heat near the bottom - if (random8() <= SEGMENT.intensity) { - uint8_t y = random8(ignition); - heat[y] = qadd8(heat[y], random8(160,255)); - } + // Step 3. Randomly ignite new 'sparks' of heat near the bottom + if (random8() <= SEGMENT.intensity) { + uint8_t y = random8(ignition); + uint8_t boost = (32+SEGMENT.custom3*2) * (2*ignition-y) / (2*ignition); + heat[y] = qadd8(heat[y], random8(64+boost,128+boost)); } // Step 4. Map from heat cells to LED colors @@ -2011,12 +2011,14 @@ uint16_t mode_fire_2012() { for (int stripNr=0; stripNr