FastLED
3.10.6
Loading...
Searching...
No Matches
◆
getAverageBrightness()
float getAverageBrightness
(
fl::span
< const
CRGB
>
leds
)
Definition at line
8
of file
auto_brightness.cpp
.
8
{
9
if
(
leds
.empty()) {
10
return
0.0f;
11
}
12
uint32_t
total = 0;
13
for
(
const
CRGB
&led :
leds
) {
14
total += led.r + led.g + led.b;
15
}
16
float
avgValue = float(total) / float(
leds
.size() * 3);
17
return
(avgValue / 255.0f) * 100.0f;
18
}
leds
CRGB leds[1]
Definition
AnalogOutput.ino:26
CRGB
fl::CRGB CRGB
Definition
crgb.h:25
uint32_t
fl::u32 uint32_t
Definition
stdint.h:218
References
leds
.
examples
MoodRing
auto_brightness.cpp
Generated on Sun Oct 4 2026 23:09:02 for FastLED by
1.13.2