Adding onboard brightness control for SK9822 #26
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@PaintYourDragon - Great meeting you at the OSH Park #BringAHack after Maker Faire Bay Area!
As discussed, here's the change to support the onboard brightness control for SK9822 LEDs.
The juicy details of the differences and the unified protocol are here: https://cpldcpu.wordpress.com/2016/12/13/sk9822-a-clone-of-the-apa102/
I noted that there was comments to the affect of onboard brightness control pull requests would not be accepted, but as we discussed this is primarily for the SK9822, though the change does not exclude using it for the APA102 if desired. To that effect I kept the default backwards compatible with the old method and included a new method
useOnboardBrightness(bool)
to enable or disable using the built-in 5-bit control. I've also slightly tweaked the protocol implementation to match the unified protocol discussed in the above linked article.I've also included updated comments that should help explain these changes and the differences between APA102 and SK9822. Using the above method to enable/disable was just what I came up with on the spot, but if you have another thought for how you would like this handled, I'm happy to oblige any requested changes.