Awgrover Neopixel library, trying to set RGB order?

In the example looking inside the box:

“Start with 6 in RGB node. Upload, and look at the pixels.
If they are Red, Green, Blue in order, then you have the right value in the RGB.
If not, then read off the colors and use the NEO_xxx that is the order shown.
Mine shows as Green Red Blue, so NEO_GRB.
Upload with that, should show as Red Green Blue when you get it right.”

Not at all sure how to set order rather than RGB or how to work out NEO_xxx order?

Realised can change label for RGB pins in the patch but still puzzled as to significance of 6 in RGB order.

Have a n GRB strip and trying numbers between 0 and 5 in place of 6 just seem to blank a pixel.


Many, many thanks to the developers . Also keen to see XOD survive , especially since just discovered it, will chip in with a donation when have a place to send it,

The value you want for a GRB strip is: 82. Not at all obvious.

The general answer is:

Look at Adafruit_NeoPixel/Adafruit_NeoPixel.h at master · adafruit/Adafruit_NeoPixel · GitHub , starting line 90, “RGB NeoPixel permutations”.

Find your color order

#define NEO_GRB ((1 << 6) | (1 << 4) | (0 << 2) | (2)) ///< Transmit as G,R,B

You can use python to get the actual value, for NEO_GRB:

print((1 << 6) | (1 << 4) | (0 << 2) | (2))

Which is 82.

Again, not obvious to a non-C++/non-arduino programmer.

The better answer probably is to supply those values as part of the XOD library, probably via a node that calculates them. I’m not likely to add this anytime soon.

Anyone have a nice, clean solution? I’d take the time to update my xod library with your merge request ( GitHub - awgrover/xod-neopixel: xod library for Arduino built from Adafruit_NeoPixel ).

1 Like

Hello, I’m sorry I can’t help you. I’ve encountered this problem recently, but it hasn’t been properly solved.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.