Power management now 1st class.

Power management now 1st class. Starting with FastLED 3.1.1 (basically, FastLED/master@HEAD- not quite rolled up into a release yet) the power management functions are “1st class citizens” of FastLED[1]. This means that now all you have to do to limit the power usage of your 5v leds is simply add:

FastLED.setMaxPowerInVoltsAndMilliamps(5,1000);

to your setup() function. FastLED.show() and FastLED.delay() will automatically use this power limit going forward.

Here’s to not blowing out our batteries too quickly or over drawing our power supplies and browning out!

(Note: this is a re-working of the power management code that @Mark_Kriegsman put in last year and works pretty much exactly the same way, just more automatically now. The old power management functions are still there, but are now marked as deprecated and simply call through to the FastLED methods).

[1] Why didn’t they start that way? I had concerns about the compiled code size for folks who weren’t using power management. Needless to say, I’ve worked around that. If you don’t set a max power usage, none of that code gets compiled in at all.

That’s awesome Daniel! Thanks for your hard work and time!

Awesome! I’ve been using the power management ever since I heard about it.

Most excellent. Thank you Daniel and Mark.

Thanks guys, you’re amazing!

You guys constantly amaze me. :slight_smile:

Thank you for your great work on this project! :slight_smile:

Really appreciate how much effort you put into this!

hey @Daniel_Garcia do you guys have a tip jar?

I will be redownloading the library for this featuer. Thank you guys for your hard work!

@Earl_Watkins_Ruralgu Don’t we all.

2 things.

  1. when is the eta
    2)how can the power management be used curently

No eta but you can just pull master from GitHub - and in the meantime you can see the old functions documented here: http://fastled.io/docs/3.1/power__mgt_8h_source.html