Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Add global brightness support for ADA102 and SK9822 #653
This pull requests makes full use of per-pixel brightness control to avoid scaling down actual color values and this preserves much better color accuracy at low brightness settings, creating pretty much "HDR mode".
I've tested this code using
To enable "HDR mode" uncomment new config parameter in
referenced this pull request
Sep 15, 2018
Users should be made aware that these two chips respond differently to changes made to these 5 bit brightness fields that might not be obvious at first, and for the APA102 has potential undesirable effects.
The APA102 brightness controls a (relatively) low frequency PWM, a frequency that can cause noticeable flicker for viewers that have relative motion to the LEDs. (ref 1) That is likely a reason that the default brightness value was set to full scale - to avoid this PWM effect.
The SK9822 has a totally different implementation of this brightness field, which appears to be based on a current regulation scheme, and does not suffer from flicker. (ref 2)
Also there has been some discussion about this brightness adjustment being scaled slightly differently between these chips, with a denominator of 31 or 32. (ref 3) In the same thread there was some concern that there may, or may not, be be some shifting of the color in the SK9822 when adjusting the brightness via GBC.
This was discussed in the comments above on this PR -- this is also why this is off by default and why, for the most part I haven't exposed the brightness at all. If/when this gets exposed in documentation for users it'll have all these caveats and more.
This is mostly temporary anyway, as this will likely get revised in the wake of the RGB16 support where the mapping options may become more interesting.