File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -3627,15 +3627,15 @@ uint16_t WS2812FX::mode_chunchun(void)
36273627{
36283628 fill (SEGCOLOR (1 ));
36293629 uint16_t counter = now*(6 + (SEGMENT.speed >> 4 ));
3630- uint16_t numBirds = SEGLEN >> 2 ;
3631- uint16_t span = SEGMENT.intensity << 8 ;
3630+ uint16_t numBirds = 2 + ( SEGLEN >> 3 ); // 2 + 1/8 of a segment
3631+ uint16_t span = ( SEGMENT.intensity << 8 ) / numBirds ;
36323632
36333633 for (uint16_t i = 0 ; i < numBirds; i++)
36343634 {
3635- counter -= span/numBirds ;
3636- int megumin = sin16 (counter) + 0x8000 ;
3635+ counter -= span;
3636+ uint16_t megumin = sin16 (counter) + 0x8000 ;
36373637 uint32_t bird = (megumin * SEGLEN) >> 16 ;
3638- uint32_t c = color_from_palette ((i * 255 )/ numBirds, false , true , 0 );
3638+ uint32_t c = color_from_palette ((i * 255 )/ numBirds, false , false , 0 ); // no palette wrapping
36393639 setPixelColor (bird, c);
36403640 }
36413641 return FRAMETIME;
You can’t perform that action at this time.
0 commit comments