Change RGB to BRG

Can you change the RGB to BRG in the settings? I have a ESP8266 with a WS2812 led strip but when I press blue I get green and vice versa. I had wled before and there I could change the color order from RGB to BRG.

I had the same problem. You have to upload the sketch with arduino IDE and change the following lines:

NeoPixelBus<NeoRgbFeature, Neo800KbpsMethod>* strip = NULL;
to
NeoPixelBus<NeoRbgFeature, Neo800KbpsMethod>* strip = NULL;

and

strip = new NeoPixelBus<NeoRgbFeature, Neo800KbpsMethod>(newCount); // and recreate with new count
to
strip = new NeoPixelBus<NeoRbgFeature, Neo800KbpsMethod>(newCount); // and recreate with new count

1 Like

This is hardcoded in the Sketch. Maybe we add a binary for future flashing of the flash tool.

install.diyhue.org

Hi.
I am changing the color definitions:
NeoPixelBus<NeoBgrFeature, Neo800KbpsMethod>* strip = NULL;
and:
strip = new NeoPixelBus<NeoBgrFeature, Neo800KbpsMethod>(newCount); // and recreate with new count
Arduino communicates about errors:
Generic_WS2812_Strip:53:13: error: ‘NeoBGRFeature’ was not declared in this scope
NeoPixelBus<NeoBGRFeature, Neo800KbpsMethod>* strip = NULL;
^
Generic_WS2812_Strip:53:44: error: template argument 1 is invalid
NeoPixelBus<NeoBGRFeature, Neo800KbpsMethod>* strip = NULL;
^
Generic_WS2812_Strip:53:53: error: invalid type in declaration before ‘=’ token
NeoPixelBus<NeoBGRFeature, Neo800KbpsMethod>* strip = NULL;
^
C:\Users\Czerniki\Desktop\Lights-master\ESP8266\Generic_WS2812_Strip\Generic_WS2812_Strip.ino: In function ‘void infoLight(RgbColor)’:
Generic_WS2812_Strip:219:12: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(i, color);
^
Generic_WS2812_Strip:220:12: error: request for member ‘Show’ in ‘* strip’, which is of non-class type ‘int’
strip->Show();
^
Generic_WS2812_Strip:222:12: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(i, black);
^
Generic_WS2812_Strip:223:12: error: request for member ‘Show’ in ‘* strip’, which is of non-class type ‘int’
strip->Show();
^
C:\Users\Czerniki\Desktop\Lights-master\ESP8266\Generic_WS2812_Strip\Generic_WS2812_Strip.ino: In function ‘void lightEngine()’:
Generic_WS2812_Strip:318:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel, convFloat(lights[light].currentColors));
^
Generic_WS2812_Strip:320:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel, blending(lights[0].currentColors, lights[1].currentColors, pixel + 1 - (dividedLightsArray[0] - transitionLeds / 2 ))); // calculate the transition led color
^
Generic_WS2812_Strip:339:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, blending( lights[light - 1].currentColors, lights[light].currentColors, pixel + 1));
^
Generic_WS2812_Strip:343:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, blending( lights[light].currentColors, lights[light + 1].currentColors, pixel + transitionLeds / 2 - dividedLightsArray[light]));
^
Generic_WS2812_Strip:346:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, convFloat(lights[light].currentColors));
^
Generic_WS2812_Strip:352:18: error: request for member ‘ClearTo’ in ‘* strip’, which is of non-class type ‘int’
strip->ClearTo(convFloat(lights[light].currentColors), 0, pixelCount - 1);
^
Generic_WS2812_Strip:354:16: error: request for member ‘Show’ in ‘* strip’, which is of non-class type ‘int’
strip->Show(); //show what was calculated previously
^
Generic_WS2812_Strip:368:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel, convFloat(lights[light].currentColors));
^
Generic_WS2812_Strip:370:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel, blending(lights[0].currentColors, lights[1].currentColors, pixel + 1 - (dividedLightsArray[0] - transitionLeds / 2 )));
^
Generic_WS2812_Strip:389:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, blending( lights[light - 1].currentColors, lights[light].currentColors, pixel + 1));
^
Generic_WS2812_Strip:393:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, blending( lights[light].currentColors, lights[light + 1].currentColors, pixel + transitionLeds / 2 - dividedLightsArray[light]));
^
Generic_WS2812_Strip:396:24: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, convFloat(lights[light].currentColors));
^
Generic_WS2812_Strip:402:18: error: request for member ‘ClearTo’ in ‘* strip’, which is of non-class type ‘int’
strip->ClearTo(convFloat(lights[light].currentColors), 0, pixelCount - 1);
^
Generic_WS2812_Strip:404:16: error: request for member ‘Show’ in ‘* strip’, which is of non-class type ‘int’
strip->Show();
^
C:\Users\Czerniki\Desktop\Lights-master\ESP8266\Generic_WS2812_Strip\Generic_WS2812_Strip.ino: In function ‘void ChangeNeoPixels(uint16_t)’:
Generic_WS2812_Strip:613:27: error: ‘NeoBGRFeature’ was not declared in this scope
strip = new NeoPixelBus<NeoBGRFeature, Neo800KbpsMethod>(newCount); // and recreate with new count
^
Generic_WS2812_Strip:613:58: error: template argument 1 is invalid
strip = new NeoPixelBus<NeoBGRFeature, Neo800KbpsMethod>(newCount); // and recreate with new count
^
Generic_WS2812_Strip:615:10: error: request for member ‘Begin’ in ‘* strip’, which is of non-class type ‘int’
strip->Begin();
^
C:\Users\Czerniki\Desktop\Lights-master\ESP8266\Generic_WS2812_Strip\Generic_WS2812_Strip.ino: In function ‘void entertainment()’:
Generic_WS2812_Strip:928:22: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel, convFloat(lights[light].currentColors));
^
Generic_WS2812_Strip:930:22: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel, blendingEntert(lights[0].currentColors, lights[1].currentColors, pixel + 1 - (dividedLightsArray[0] - transitionLeds / 2 )));
^
Generic_WS2812_Strip:948:22: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, blendingEntert( lights[light - 1].currentColors, lights[light].currentColors, pixel + 1));
^
Generic_WS2812_Strip:952:22: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, blendingEntert( lights[light].currentColors, lights[light + 1].currentColors, pixel + transitionLeds / 2 - dividedLightsArray[light]));
^
Generic_WS2812_Strip:955:22: error: request for member ‘SetPixelColor’ in ‘* strip’, which is of non-class type ‘int’
strip->SetPixelColor(pixel + pixelSum + transitionLeds, convFloat(lights[light].currentColors));
^
Generic_WS2812_Strip:961:16: error: request for member ‘ClearTo’ in ‘* strip’, which is of non-class type ‘int’
strip->ClearTo(convFloat(lights[light].currentColors), 0, pixelCount - 1);
^
Generic_WS2812_Strip:964:12: error: request for member ‘Show’ in ‘* strip’, which is of non-class type ‘int’
strip->Show();
^
exit status 1
‘NeoBGRFeature’ was not declared in this scope

Please help me.

Looks like you don’t have the neopixel library installed. Add them in arduino library manager.

Neopixel by hakuna

Has this topic been resolved?