implement simple min white calculation

This commit is contained in:
interfisch 2020-12-01 23:27:56 +01:00
parent 151f9e8c43
commit f36c7ed634
2 changed files with 18 additions and 4 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.pio

View File

@ -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 <Arduino.h>
@ -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