From e06d269b82f0f5709a7d959ba4244c0b19845572 Mon Sep 17 00:00:00 2001 From: Blaz Kristan Date: Mon, 15 Mar 2021 17:01:56 +0100 Subject: [PATCH] Slight modification of Chunchun effect. --- wled00/FX.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wled00/FX.cpp b/wled00/FX.cpp index 786ea692..77a57ff3 100644 --- a/wled00/FX.cpp +++ b/wled00/FX.cpp @@ -3628,15 +3628,15 @@ uint16_t WS2812FX::mode_chunchun(void) { fill(SEGCOLOR(1)); uint16_t counter = now*(6 + (SEGMENT.speed >> 4)); - uint16_t numBirds = SEGLEN >> 2; - uint16_t span = SEGMENT.intensity << 8; + uint16_t numBirds = 2 + (SEGLEN >> 3); // 2 + 1/8 of a segment + uint16_t span = (SEGMENT.intensity << 8) / numBirds; for (uint16_t i = 0; i < numBirds; i++) { - counter -= span/numBirds; - int megumin = sin16(counter) + 0x8000; + counter -= span; + uint16_t megumin = sin16(counter) + 0x8000; uint32_t bird = (megumin * SEGLEN) >> 16; - uint32_t c = color_from_palette((i * 255)/ numBirds, false, true, 0); + uint32_t c = color_from_palette((i * 255)/ numBirds, false, false, 0); // no palette wrapping setPixelColor(bird, c); } return FRAMETIME;