Hello! I want to advice to make new FastLED useful function ))
I’m not good programmer (and not so good speaks English, sorry), but I think this function may be useful for many people.
Function, that calculating theoretical power consumption of current sketch.
As we know - with full brightness and full white LEDs current is about 60ma. I know, that there are many nuances, like power source, wires length and diameter and many-many others.
But it is interesting to know, rainbow algorithm how more take current by comparison with sinelon fo example.
And I think - function would be able to say that ))
Rainbow takes ~47% of total full white, I have already calcs it. I send rainbow with E1.31, than parsing universes values and summ them total. It was very uncomfortable ))
LEDS.getFPS() - not very accurate function, but useful.
LEDS.getPower() - may be also not very accurate, but useful )
As I know - we need to calc logarithm of total leds, that we drive. It is very hard for microprocessors like arduino or ESP8266, but we can do this not very often.
It would be smart to add parameters, like how often calc logarithm of leds array data. More frequently is mean more accurate.
This gives for us to look about current power consumption. But if we have many animations, it would be nice to add parameter, that would be say how often calculating logarithm of previously calculated logarithm of leds. With this we can know about total average sketch power needs (and power companies billings ) ).
As I see how this need to work: LEDS.getPower(100, 20); will calc every 100 msec(or every 100-th calling of FastLED.show() (led1.r + led1.g+led1.b+led2.r+led2.g+led2.b+…ledN.b)/NUM_LEDS*3,
It will be CurrentPowerConsumption parameter.
And every 20 mesurements will average continuously to AvaregePowerConsumption parameter.
In serial it would print Curr: 112; Average: 187.
We can map it from 0:255 to 0:100 if we need to see in percents and easy calc in mAmps.
Hope you understand me ) May be my vision of this function is totally foolish. I’m not good programmer, But I think we need to know average power of our animations, that like truth info.
May be someone write this function.
Sorry for pore English. Thanks!