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 @@ -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;
You can’t perform that action at this time.
0 commit comments