mirror of
https://github.com/wled/WLED.git
synced 2025-07-27 12:46:38 +00:00
meteor with framerate
This commit is contained in:
parent
b2439ca0af
commit
9bc72df1b5
@ -1882,7 +1882,8 @@ uint16_t WS2812FX::mode_lake() {
|
|||||||
// adapted from https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/#LEDStripEffectMeteorRain
|
// adapted from https://www.tweaking4all.com/hardware/arduino/adruino-led-strip-effects/#LEDStripEffectMeteorRain
|
||||||
uint16_t WS2812FX::mode_meteor() {
|
uint16_t WS2812FX::mode_meteor() {
|
||||||
byte meteorSize= 1+ SEGLEN / 10;
|
byte meteorSize= 1+ SEGLEN / 10;
|
||||||
uint16_t in = SEGMENT.start + SEGENV.step;
|
uint16_t counter = now * ((SEGMENT.speed >> 2) +8);
|
||||||
|
uint16_t in = counter * SEGLEN >> 16;
|
||||||
|
|
||||||
// fade all leds to colors[1] in LEDs one step
|
// fade all leds to colors[1] in LEDs one step
|
||||||
for (uint16_t i = SEGMENT.start; i < SEGMENT.stop; i++) {
|
for (uint16_t i = SEGMENT.start; i < SEGMENT.stop; i++) {
|
||||||
@ -1905,8 +1906,7 @@ uint16_t WS2812FX::mode_meteor() {
|
|||||||
setPixelColor(index, color_from_palette(_locked[index], false, true, 255));
|
setPixelColor(index, color_from_palette(_locked[index], false, true, 255));
|
||||||
}
|
}
|
||||||
|
|
||||||
SEGENV.step = (SEGENV.step + 1) % (SEGLEN);
|
return FRAMETIME;
|
||||||
return SPEED_FORMULA_L;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user