Hello - I am working on a project that requires 2 strands of high powered leds - however each strand has different LED power requirements but both strands work off of WS2811 platform. Is there anyway to to do the power management per strand. Even if I had to fool the static constants for V and I per strand that would help. I am using a controller base type FastLed[0]… to control each strands brightness but have not figured out how to burrow down the Friend CFastLed to get to individual strands.
As I understand it, and I could be wrong, you only need to use power management if you don’t have sufficient power to run all of the LEDs at maximum white brightness… So if you have enough power, you don’t need it.
Do you have enough power?
Hi Jeremy
I have sufficient resources but I have a heat issue that I want to limit the power to.
Dale I think this can be done but you will have to use each led controller separately. When you define an LED strip with FastLED.addLeds call you are createing a CLEDController instance. If you check out the implementation of FastLED.show https://github.com/FastLED/FastLED/blob/master/FastLED.cpp#L45 you can see that this function is pretty simple.
It first uses the power function defined here https://github.com/FastLED/FastLED/blob/master/FastLED.h#L466 to calculate the brightness scale to apply to the LEDs and then it loops over each controller and applies dithering and scale before outputting the LEDs on that controller.
So you can probably use all these parts to set the brightness yourself based on the power requirements for each controller individually, but it’ll take a little bit of work.
Thanks Ben … so syntactically how do you call the function based up the controller. The controller class allows friends to CFastLed but I am not a C++ expert and am at a loss on how to access each function based upon the controller. I have split them off and use them individually (renaming) and it work if I use it out side the library
I don’t think you need to access any of the internals of the CLEDController instance, most of the methods you need are public.
I put together a little gist showing what I’m thinking should work, but I’ve not tested any of this obviously:
I think first you need to call your FastLED.addLEDs methods to setup your controllers as normal, but then keep the returned reference to the CLEDController each time. Then instead of calling FastLED.show make a new method in your project that you will call instead. This method will have to call show on each of your controllers, but first will need to calculate what brightness (scale) value to pass to the show method on a per-controller basis using the calculate_max_brightness_for_power_mW or calculate_max_brightness_for_power_vmA methods. These are both public and take an array of LEDs, which you can just retrieve from your controllers.
Hope that helps.
Thanks Ben
That does help - a lot!