WS2812RGB, BRG or GRB?

Posted on
  • Hi,

    Playing more with the STM32F4 Discovery...trying to make some WS2812 LEDs work. Just learning about Espruino and JavaScript. So far I like both a lot.

    Small problem though: The data sent via

    SPI2.setup({baud:3200000, mosi:B15});
    SPI2.send4bit([16,16,16, 1,1,1, 8,8,8, 16,0,0, 0,16,0, 0,0,16], 0b0001, 0b0011);
    

    seems to be G, R, B which is slightly unusual and unexpected.
    Above line lights up 6 LEDs: gray16, gray1, gray8, Green, Red, Blue

    I'm ok with RGB or BGR but GRB looks like an error. Is this a known bug?

    I'm running Espruino 1v80.1 for the F4 Discovery.

  • Well that's what WS2812 are expecting. See page 5 of datasheet

  • Yes - It's what you'd expect (I don't know why they thought it was a good idea!).

    Unfortunately it changes depending on the LED modules used - WS2811-based stuff is one other, WS2812 is another.

  • Silly me...I did not expect that. Thanks. Another simple problem solved.

  • WorldSemi is fast painting themselves into a corner - when they get to the WS2817, they'll be in trouble, because there are only 6 possible orders for the three colors, and they'll have used them all already...

    (worth noting that on the 2811, you can wire whichever pin you damned well please to each color... so assembled modules could be anything)

  • They could add h,s,v control, thus paving the way for lots more permutations!

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

WS2812RGB, BRG or GRB?

Posted by Avatar for HaraldK @HaraldK

Actions