|
FastLED 3.10.8
|
| fl::u8 calculate_max_brightness_for_power_mW | ( | const CRGB * | ledbuffer, |
| fl::u16 | numLeds, | ||
| fl::u8 | target_brightness, | ||
| fl::u32 | max_power_mW ) |
Determines the highest brightness level you can use and still stay under the specified power budget for a given set of LEDs.
What the budget bounds, stated rather than implied (#4156 R4):
PowerModel::dark_mW is drawn per LED at every brightness including zero, so it is subtracted from the budget first and only the remainder is divided among the emitters. A budget at or below the baseline returns 0: no brightness meets it, and a lit strip would be promising a bound that cannot be held at any setting.CRGB values, and BINARY_DITHER adds its offset afterwards, inside the encoder. That offset is shared across the frame, so a dithered frame can exceed the budgeted demand by up to one native code per channel per pixel – about 0.8 mW per LED on the default WS2812 model. The multi-frame mean is what the budget holds; a single latched frame can sit that much above it.| ledbuffer | the LED data to check |
| numLeds | the number of LEDs in the data array |
| target_brightness | the brightness you'd ideally like to use |
| max_power_mW | the max power draw desired, in milliwatts |
Definition at line 464 of file power_mgt.cpp.hpp.
References brightness_within_budget(), calculate_unscaled_power_mW(), fixed_power_mW(), and FL_NO_EXCEPT.
Referenced by calculate_max_brightness_for_power_vmA(), and CFastLED::setMaxPowerInMilliWatts().
Here is the call graph for this function:
Here is the caller graph for this function: