# Change RGB to BRG

**URL:** https://diyhue.discourse.group/t/change-rgb-to-brg/404
**Category:** Support
**Tags:** esp8266
**Created:** [December 28, 2021, 5:47pm UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404 "2021-12-28T17:47:14Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ryan\_voorspoels](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@ryan\_voorspoels](https://diyhue.discourse.group/u/ryan_voorspoels)
#### Post date: [December 28, 2021, 5:47pm UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404/1 "2021-12-28T17:47:14Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![xYoshiox](https://yyz2.discourse-cdn.com/free1/user_avatar/diyhue.discourse.group/xyoshiox/32/207_2.png) [@xYoshiox](https://diyhue.discourse.group/u/xYoshiox)
#### Post date: [January 2, 2022, 10:29pm UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404/2 "2022-01-02T22:29:47Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Mevel](https://yyz2.discourse-cdn.com/free1/user_avatar/diyhue.discourse.group/mevel/32/34_2.png) [@Mevel](https://diyhue.discourse.group/u/Mevel)
#### Post date: [January 22, 2022, 10:13am UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404/3 "2022-01-22T10:13:32Z")

</div>

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

[install.diyhue.org](http://install.diyhue.org)

---

<div class="post-metadata">

### Author: ![annon](https://avatars.discourse-cdn.com/v4/letter/a/bbe5ce/32.png) [@annon](https://diyhue.discourse.group/u/annon)
#### Post date: [May 22, 2022, 7:17pm UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404/4 "2022-05-22T19:17:50Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![Mevel](https://yyz2.discourse-cdn.com/free1/user_avatar/diyhue.discourse.group/mevel/32/34_2.png) [@Mevel](https://diyhue.discourse.group/u/Mevel)
#### Post date: [June 5, 2022, 3:30pm UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404/5 "2022-06-05T15:30:15Z")

</div>

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

Neopixel by hakuna

---

<div class="post-metadata">

### Author: ![Mevel](https://yyz2.discourse-cdn.com/free1/user_avatar/diyhue.discourse.group/mevel/32/34_2.png) [@Mevel](https://diyhue.discourse.group/u/Mevel)
#### Post date: [June 29, 2022, 9:43am UTC](https://diyhue.discourse.group/t/change-rgb-to-brg/404/6 "2022-06-29T09:43:24Z")

</div>

Has this topic been resolved?
