Skip to content

Commit e06d269

Browse files
committed
Slight modification of Chunchun effect.
1 parent 76e269e commit e06d269

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

wled00/FX.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3628,15 +3628,15 @@ uint16_t WS2812FX::mode_chunchun(void)
36283628
{
36293629
fill(SEGCOLOR(1));
36303630
uint16_t counter = now*(6 + (SEGMENT.speed >> 4));
3631-
uint16_t numBirds = SEGLEN >> 2;
3632-
uint16_t span = SEGMENT.intensity << 8;
3631+
uint16_t numBirds = 2 + (SEGLEN >> 3); // 2 + 1/8 of a segment
3632+
uint16_t span = (SEGMENT.intensity << 8) / numBirds;
36333633

36343634
for (uint16_t i = 0; i < numBirds; i++)
36353635
{
3636-
counter -= span/numBirds;
3637-
int megumin = sin16(counter) + 0x8000;
3636+
counter -= span;
3637+
uint16_t megumin = sin16(counter) + 0x8000;
36383638
uint32_t bird = (megumin * SEGLEN) >> 16;
3639-
uint32_t c = color_from_palette((i * 255)/ numBirds, false, true, 0);
3639+
uint32_t c = color_from_palette((i * 255)/ numBirds, false, false, 0); // no palette wrapping
36403640
setPixelColor(bird, c);
36413641
}
36423642
return FRAMETIME;

0 commit comments

Comments
 (0)