FastLED 3.9.15
Loading...
Searching...
No Matches

◆ getAverageBrightness()

float getAverageBrightness ( CRGB * leds,
int numLeds )

Definition at line 4 of file auto_brightness.cpp.

4 {
5 uint32_t total = 0;
6 for (int i = 0; i < numLeds; i++) {
7 total += leds[i].r + leds[i].g + leds[i].b;
8 }
9 float avgValue = float(total) / float(numLeds * 3);
10 return (avgValue / 255.0f) * 100.0f;
11}
fl::CRGB leds[NUM_LEDS]
fl::u32 uint32_t
Definition s16x16x4.h:219

References leds.

Referenced by loop().

+ Here is the caller graph for this function: