-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Research: Using FastLED under the hood #42
Comments
One method of fading between two colors in FastLED is called I'm thinking I'll be making a POC of this project + FastLED within the next few days. |
I did a little bit more research into this. FastLED isn't really meant to be used with analog LEDs, but all of the math and blending still works fine. Here's an example of setting up a non-addressable LED strip with the framework. I haven't found how to use the color correction or color temperature adjustments with analog strips, as that conversion is normally set globally (which we can't use). This also means that we can't use the global brightness. Edit: Maybe I'm overthinking that. Couldn't we just bitwise |
I think my edit above is correct. As a quick test, I added the following to
(I acknowledge that there are probably cleaner ways to do that bit manipulation, but this was a quick test.) In the new structure in #43, this could be contained inside of |
No. I was wrong and I shouldn't do bit math at 11:30 PM. Also, FastLED to the rescue. They provide scaling functions like
|
If you use HSB internally instead of RGB, fading between two colors is a lot easier. Here is a example https://github.com/rvt/Arilux_AL-LC0X/blob/master/FadingFilter.cpp This class fadestowards the desired HSB as given during method call. Fading between the colors is done over the color wheel. Then brightness and saturation are easy as well as white colors. |
FastLED is a great framework for working with digital LED strips (NeoPixels, for example) and animations, but it does also support "dumb" analog LEDs.
I'd like to research if it would be worth including FastLED into this project for some of its features. For example, it support color correction, which could cover #16 (gamma correction to make the strip look better) and #27 (supporting other color temperatures). Some other features, like global brightness and HSV support, could be helpful as well.
I don't think much of the animation stuff would be applicable, but I want to know if FastLED has a standard way to fade between two colors. If so, that would eliminate the big chunk of math and complexity as well as a lot of the timing dependencies.
One possible blocker for this is that FastLED doesn't seem to support RGBW at the moment. There should be ways to make it work in this project because we're dealing with simple, analog LEDs, but native support would be benefitial.
(This is mostly just a brain-dump at the moment. When I get to do some research, I'll update/comment here.)
The text was updated successfully, but these errors were encountered: