Hi All,
I’ve been looking for a way to calibrate an RGB Strip, so I can get an accurate color temperature. I believe FastLED is that, but I seem to have a currently unsupported setup, and I wanted to see if anyone knew of other options I could pursue.
Here’s the setup:
Raspberry Pi driving an RGB strip (wired via a breadboard)
RGB strip has four inputs: Power, Red [0,255], Green [0,255], Blue [0,255]
That’s it!
Right now I’ve written the code to determine the color temperature I want, based on time of day (like redshift, but in python). Now I just need to figure out how to get the RGB strip to reflect that temperature.
When using the FastLED code, color correction for a strip can be done like this:
FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS).setCorrection(255,128,192);
The above extreme example would remove 50% of the Green and 25% of the Blue from whatever color a pixel was set to. This scaling is applied to a pixel’s value right before the data is sent out to be displayed, so it takes place “under the hood” and you don’t have to consider color correction when coding animations.
You should be able to do something similar in your python code. Create a subroutine that is run on all the pixel values right before the data is sent out to be displayed. If you wanted to shift the output to be more red you would subtract a certain amount of blue and green (or multiply blue and green by something less then 1.0).
I haven’t dug into the code far enough to find exactly where/how a color correct is being applied, but I think it’s doing something like scale8.
So for example if you determined your CC should be less blue by 10, then the Blue channel would be adjusted something like (sudo code):