Determines how many milliwatts the current LED data would draw at max brightness (255)
- Parameters
-
ledbuffer | the LED data to check |
numLeds | the number of LEDs in the data array |
- Returns
- the number of milliwatts the LED data would consume at max brightness
Definition at line 61 of file power_mgt.cpp.
62{
63 uint32_t red32 = 0, green32 = 0, blue32 = 0;
64 const CRGB* firstled = &(ledbuffer[0]);
65 uint8_t*
p = (uint8_t*)(firstled);
66
67 uint16_t count = numLeds;
68
69
70 while( count) {
74 --count;
75 }
76
80
81 red32 >>= 8;
82 green32 >>= 8;
83 blue32 >>= 8;
84
85 uint32_t total = red32 + green32 + blue32 + (
gDark_mW * numLeds);
86
87 return total;
88}
static FASTLED_NAMESPACE_BEGIN uint8_t const p[]
static const uint8_t gGreen_mW
11mA @ 5v = 55mW
static const uint8_t gBlue_mW
15mA @ 5v = 75mW
static const uint8_t gRed_mW
16mA @ 5v = 80mW
static const uint8_t gDark_mW
1mA @ 5v = 5mW
Representation of an RGB pixel (Red, Green, Blue)
References gBlue_mW, gDark_mW, gGreen_mW, gRed_mW, and p.
Referenced by calculate_max_brightness_for_power_mW(), and calculate_max_brightness_for_power_mW().