Skip to content

NeoPixelBusLg object

Michael Miller edited this page Apr 6, 2023 · 4 revisions

See NeoPixeBus object for more details on the general use of this object.
See NeoPixelBusLg object API Reference for more details on the methods exposed.

This object is provided to wrap up concepts of luminance control with gamma correction in a supportable object for most users. If you need to "Render()" into it, look at the exposed Shader object.

This object differs from the normal NeoPixelBus by supporting a strip wide luminance feature with gamma correction.
This object allows one place to set and query a general luminance of the entire strip. When the luminance is changed, all pixels that are set after the change will be modified.
The human eye perceives light levels differently than what the NeoPixels or DotStars show. The LEDs brightness levels are very linear so the gamma correction will convert them to a nonlinear curve so that what you see is what you expected. Providing a better overall brightness level across the colors.
Note: When the luminance is changed, it does not change current pixels values as the original values before being modified by luminance and corrected for gamma are not stored and thus cannot be reconstituted and run back through the modifications.

Just like the normal NeoPixelObject, it must be constructed with a "Feature" and a "Method" object that define which pixels you are using and how they are updated.

NeoPixelBusLg<NeoGrbFeature, NeoWs2812xMethod> strip(pixelCount, pixelPin);

A new optional template specialization "T_GAMMA" has been added to control how gamma correction is done. The default if not specified is a slower but more accurate equation method. This can easily be changed by providing one of the many alternatives, in this example below the faster table lookup method is defined.

NeoPixelBusLg<NeoRgbFeature, NeoWs2812xMethod, NeoGammaTableMethod> strip(PixelCount, PixelPin);
Clone this wiki locally