Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SK6812RGBW has R & G reversed #32

Closed
edalquist opened this issue Dec 2, 2016 · 4 comments
Closed

SK6812RGBW has R & G reversed #32

edalquist opened this issue Dec 2, 2016 · 4 comments

Comments

@edalquist
Copy link

Not sure if this is a library issue or an issue with my specific LEDs.

I have a set of these: https://www.amazon.com/gp/product/B01HXOJ4HU/

I have to swap the R & G values when I call strip.Color:

strip.Color(0, 255, 0), // red
strip.Color(255, 0, 0), // green
strip.Color(0, 0, 255), // blue
strip.Color(0, 0, 0, 255) // white
@technobly
Copy link
Owner

That strip you linked to is not RGBW, but rather RGB only if it's truly SK6812 and not SK6812RGBW. They should be the same as WS2812B type.

Try

#define PIXEL_TYPE WS2812B

@edalquist
Copy link
Author

It has all 4 LEDs. Setting strip.Color(255, 255, 255) lights all 3 RGB LEDs, strip.Color(0, 0, 0, 255) lights the one W LED and strip.Color(255, 255, 255, 255) lights all 4 LEDs

I'll give WS2812B a try when I get home just to confirm.

@technobly
Copy link
Owner

Ok interesting. I created the SK6812RGBW pixel type support with an Adafruit RGBW 24 pixel ring and I'm sure I would have tested the color order. Referencing the datasheet, it says RGBW order which is the same as the code.

It's possible you have a knock off or just a different version and the colors need to be swapped. It would probably be best to incorporate the different pixel color arrangements as in the original library:
https://github.com/adafruit/Adafruit_NeoPixel/blob/master/Adafruit_NeoPixel.h#L52-L89

We would have to do it a bit differently though, since we skewed away from the 400kHz vs 800kHz speed settings and opted for direct pixel type mapping. It would work the same though, like

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_COUNT 10
#define PIXEL_PIN D2
#define PIXEL_TYPE WS2812B
#define PIXEL_COLOR NEO_GRBW

// Parameter 1 = number of pixels in strip
//               note: for some stripes like those with the TM1829, you
//                     need to count the number of segments, i.e. the
//                     number of controllers in your stripe, not the number
//                     of individual LEDs!
// Parameter 2 = pin number (most are valid)
//               note: if not specified, D2 is selected for you.
// Parameter 3 = pixel type [ WS2812, WS2812B, WS2812B2, WS2811,
//                             TM1803, TM1829, SK6812RGBW ]
//               note: if not specified, WS2812B is selected for you.
//               note: RGB order is automatically applied to WS2811,
//                     WS2812/WS2812B/WS2812B2/TM1803 is GRB order.
//
// 800 KHz bitstream 800 KHz bitstream (most NeoPixel products
//               WS2812 (6-pin part)/WS2812B (4-pin part)/SK6812RGBW (RGB+W) )
//
// 400 KHz bitstream (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//                   (Radio Shack Tri-Color LED Strip - TM1803 driver
//                    NOTE: RS Tri-Color LED's are grouped in sets of 3)

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_COLOR + PIXEL_TYPE);

@edalquist
Copy link
Author

So I checked with a friend that is using the same strips and they are GRB pixels. This issue can be closed and I'll poke around to see if I can make those changes work (and send a pull request if I do).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants