fl::UISlider brightness("Brightness", BRIGHTNESS, 0, 255)
Internal FastLED header for implementation files.
fl::u32 calculate_unscaled_power_mW(const CRGB *ledbuffer, fl::u16 numLeds)
Determines how many milliwatts the current LED data would draw at max brightness (255)
void show_at_max_brightness_for_power()
Similar to CFastLED::show(), but pre-adjusts brightness to keep below the power threshold.
fl::u32 scale_power_for_brightness(fl::u32 total_mW, fl::u8 brightness)
Applies the configured power-scaling response to a total power value.
void set_max_power_indicator_LED(fl::u8 pinNumber)
Select a pin with an LED that will be flashed to indicate that power management is pulling down the b...
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 f...
void delay_at_max_brightness_for_power(fl::u16 ms)
Similar to CFastLED::delay(), but pre-adjusts brightness to keep below the power threshold.
void set_max_power_in_volts_and_milliamps(fl::u8 volts, fl::u32 milliamps)
Set the maximum power used in milliamps for a given voltage.
void set_max_power_in_milliwatts(fl::u32 powerInmW)
Set the maximum power used in watts.
fl::u8 calculate_max_brightness_for_power_vmA(const CRGB *ledbuffer, fl::u16 numLeds, fl::u8 target_brightness, fl::u32 max_power_V, fl::u32 max_power_mA)
Determines the highest brightness level you can use and still stay under the specified power budget f...
void set_power_model(const PowerModelRGB &model)
Set custom RGB LED power consumption model.
float get_power_scaling_exponent()
Get the current brightness-to-power response exponent.
void set_power_scaling_exponent(float exponent)
Set a non-linear brightness-to-power response exponent.
PowerModelRGB get_power_model()
Get current RGB power model.
Includes defintions for RGB and HSV pixels.
fl::u8 blue_mW
Blue channel power at full brightness (255), in milliwatts.
fl::u8 dark_mW
Dark LED baseline power consumption, in milliwatts.
fl::u8 red_mW
Red channel power at full brightness (255), in milliwatts.
float exponent
Brightness-to-power response exponent (1.0 = linear)
fl::u8 green_mW
Green channel power at full brightness (255), in milliwatts.
constexpr PowerModelRGB(fl::u8 r, fl::u8 g, fl::u8 b, fl::u8 d, float e=1.0f)
Custom RGB power model.
constexpr PowerModelRGB()
Default constructor - WS2812 @ 5V (16mA/11mA/15mA @ 5V), linear response.
RGB LED power consumption model Used for standard 3-channel LEDs (WS2812, WS2812B,...
constexpr PowerModelRGBW()
Default constructor - SK6812 RGBW @ 5V estimate, linear response.
float exponent
Brightness-to-power response exponent (1.0 = linear)
fl::u8 green_mW
Green channel power at full brightness (255), in milliwatts.
fl::u8 dark_mW
Dark LED baseline power consumption, in milliwatts.
fl::u8 blue_mW
Blue channel power at full brightness (255), in milliwatts.
constexpr PowerModelRGB toRGB() const
Convert to RGB model (extracts RGB components, preserves exponent)
constexpr PowerModelRGBW(fl::u8 r, fl::u8 g, fl::u8 b, fl::u8 w, fl::u8 d, float e=1.0f)
Custom RGBW power model.
fl::u8 white_mW
White channel power at full brightness (255), in milliwatts.
fl::u8 red_mW
Red channel power at full brightness (255), in milliwatts.
RGBW LED power consumption model.
fl::u8 white_mW
Cool white channel power at full brightness (255), in milliwatts.
float exponent
Brightness-to-power response exponent (1.0 = linear)
fl::u8 green_mW
Green channel power at full brightness (255), in milliwatts.
fl::u8 warm_white_mW
Warm white channel power at full brightness (255), in milliwatts.
fl::u8 red_mW
Red channel power at full brightness (255), in milliwatts.
constexpr PowerModelRGBWW()
Default constructor - Hypothetical RGBWW @ 5V estimate, linear response.
fl::u8 blue_mW
Blue channel power at full brightness (255), in milliwatts.
fl::u8 dark_mW
Dark LED baseline power consumption, in milliwatts.
constexpr PowerModelRGB toRGB() const
Convert to RGB model (folds W/WW power back into RGB so the brightness limiter doesn't under-budget).
constexpr PowerModelRGBWW(fl::u8 r, fl::u8 g, fl::u8 b, fl::u8 w, fl::u8 ww, fl::u8 d, float e=1.0f)
Custom RGBWW power model.
RGBWW LED power consumption model (RGB + Cool White + Warm White)