ancher-bohdan / LedStrip

Adress Led Strip (ws2812) with STM32 microcontroller`s family
0 stars 0 forks source link

Get rid of "ninja" effect #11

Closed ancher-bohdan closed 4 years ago

ancher-bohdan commented 5 years ago

This effect is reproduced, when I am trying to display some simple dynamical effect. Use function ws2812_transfer_recurrent in infinite loop.

STR:

  1. Construct some equation, as an argument to mentioned function. For simplicity, use only one color. For example argument for red color might be constructed as follows *while(1) { sprintf(a, "1lin+0;%d...110", i); i++; if(i >= 220) i = 1; }**
  2. In the same infinite loop pass constructed argument to function ws2812_transfer. Leave all other color as NULL. Resulting code might look like this: *while (1) { sprintf(a, "1lin+0;%d...110", i); ws2812_transfer_recurrent(a, NULL, NULL, 144); i++; if(i == 220) i = 1; HAL_Delay(10); }**

Actual result: There are one led, red component of them are equal to 0. So I see one led that not lighting. And this led is moving. Moving very fast. That why this effect is calling "ninja".

Expected result: Theoretically, linear updating was designed in that way, that the last one must not return 0 in any way.

Investigate why it is happening. If it is possible, get rid of this effect.

ancher-bohdan commented 4 years ago

It don`t reproduce in all releases. Close this issue