diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..03f4a3c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.pio diff --git a/src/main.cpp b/src/main.cpp index a750398..cecf01c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -19,7 +19,13 @@ * */ -#define SK6812RGBW +#define SK6812RGBW //power consumption is around 51mA per LED at RGBW 100% +/* + R=1234mA (with 112 LEDS 100%) + G=1234mA (with 112 LEDS 100%) + B=1090mA (with 112 LEDS 100%) + W=2100mA (with 112 LEDS 100%) +*/ #include @@ -259,9 +265,16 @@ void dataMode(){ #if defined(SK6812RGBW) //Copy data over - for(int i = 0; i < Num_Leds; i++){ - //send_leds[i] = CRGBW(0, 0, 0, 50); - send_leds[i] = CRGBW(leds[i].r, leds[i].g, leds[i].b, 0); + for(int i = 0; i < Num_Leds; i++){ + uint8_t r=leds[i].r; + uint8_t g=leds[i].g; + uint8_t b=leds[i].b; + uint8_t w=min(r,min(g,b)); //get white content and use for white + r-=w; //subtract white content + g-=w; + b-=w; + + send_leds[i] = CRGBW(r, g, b, w); //transfer to rgbw struct } #endif