FastLED 3.9.15
Loading...
Searching...
No Matches
Power Management Functions

Detailed Description

Functions to limit the amount of power used by FastLED.

+ Collaboration diagram for Power Management Functions:

Topics

 LED Power Consumption Models
 Configurable power consumption models for different LED types.
 

Power Control Setup Functions

Functions to initialize the power control system

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.
 
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 brightness.
 

Power Control 'show()' and 'delay()' Functions

Power-limiting replacements of show() and delay().

These are drop-in replacements for CFastLED::show() and CFastLED::delay(). In order to use these, you have to actually replace your calls to CFastLED::show() and CFastLED::delay() with these two functions.

Deprecated
These functions are deprecated as of 6ebcb64, circa 2015. Do not use them for new programs.
void show_at_max_brightness_for_power ()
 Similar to CFastLED::show(), but pre-adjusts brightness to keep below the power threshold.
 
void delay_at_max_brightness_for_power (fl::u16 ms)
 Similar to CFastLED::delay(), but pre-adjusts brightness to keep below the power threshold.
 

Power Control Internal Helper Functions

Internal helper functions for power control.

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)
 
fl::u32 calculate_unscaled_power_mW (fl::span< const CRGB > leds)
 
fl::u32 scale_power_for_brightness (fl::u32 total_mW, fl::u8 brightness)
 Applies the configured power-scaling response to a total power value.
 
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.
 
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 for a given set of LEDs.
 
fl::u8 calculate_max_brightness_for_power_mW (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 all sets of LEDs.