FastLED 3.9.15
Loading...
Searching...
No Matches

◆ RECOMMENDED_VIRTUAL_BITS

#define RECOMMENDED_VIRTUAL_BITS
Value:

Set "virtual bits" of dithering to the highest level that is not likely to cause excessive flickering at low brightness levels + low update rates.

These pre-set values are a little ambitious, since a 400Hz update rate for WS2811-family LEDs is only possible with 85 pixels or fewer. Once we have a "number of milliseconds since last update" value available here, we can quickly calculate the correct number of "virtual bits" on the fly with a couple of "if" statements – no division required. At this point, the division is done at compile time, so there's no runtime cost, but the values are still hard-coded.

Todo
Can these macros be replaced with constants scoped to PixelController::init_binary_dithering()?

Definition at line 210 of file pixel_controller.h.

210#define RECOMMENDED_VIRTUAL_BITS ((UPDATES_PER_FULL_DITHER_CYCLE>1) + \
211 (UPDATES_PER_FULL_DITHER_CYCLE>2) + \
212 (UPDATES_PER_FULL_DITHER_CYCLE>4) + \
213 (UPDATES_PER_FULL_DITHER_CYCLE>8) + \
214 (UPDATES_PER_FULL_DITHER_CYCLE>16) + \
215 (UPDATES_PER_FULL_DITHER_CYCLE>32) + \
216 (UPDATES_PER_FULL_DITHER_CYCLE>64) + \
217 (UPDATES_PER_FULL_DITHER_CYCLE>128) )