Teensy3.1 + Octows2811 + 12V ws2811 strips RGB swapped

Status
Not open for further replies.
Good evening - I've been trying to find a similar problem posted, but am having trouble. I have an array of ~3k LEDs that I'm controlling with a pair of Teensy + Octows2811's. Everything is wired up and lighting well (I had previously controlled this array with an Arduino Mega and FastLED, but I'm wanting to use the movie2serial to up the complexity of patterns displayed. Also, since I was simply creating random fades and wipes, I never worried much about the specific colors being displayed).

Once everything was wired up, i started with BasicTest to make sure I had the LEDs set up correctly, and have hit a snag - I can't find the right color channel order to make it work.

(from BasicTest.ino)

Code:
#include <OctoWS2811.h>

const int ledsPerStrip = 50;

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];

const int config = WS2811_GRB | WS2811_800kHz;

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

void setup() {
  leds.begin();
  leds.show();
}

#define RED    0xFF0000
#define GREEN  0x00FF00
#define BLUE   0x0000FF
#define YELLOW 0xFFFF00
#define PINK   0xFF1088
#define ORANGE 0xE05800
#define WHITE  0xFFFFFF

void loop() {
  int microsec = 2000000 / leds.numPixels();  // change them all in 2 seconds

  colorWipe(RED, microsec);
  colorWipe(GREEN, microsec);
  colorWipe(BLUE, microsec);
  colorWipe(YELLOW, microsec);
  colorWipe(PINK, microsec);
  colorWipe(ORANGE, microsec);
  colorWipe(WHITE, microsec);
}

void colorWipe(int color, int wait)
{
  for (int i=0; i < leds.numPixels(); i++) {
    leds.setPixel(i, color);
    leds.show();
    delayMicroseconds(wait);
  }
}

I've tried altering the line:

Code:
const int config = WS2811_GRB | WS2811_800kHz;

with every permutation of "_GRB" and get the following wipe patterns:
above

Expected wipe pattern in code above: Red, Green, Blue...

_GRB = Red, Blue, Green

_GBR = Green, Blue, Red

_BGR = Blue, Red, Green

_BRG = Blue, Red, Green

_RGB = Blue, Red, Green

_RBG = Blue, Green, Red


Can you think of something I'm doing wrong? I'm new to all this, but trying to put in the time to understand the code I'm writing. I'm concerned though that the super cheap knock off LED strips I got from China are SO non-standard that they would require me to alter the octows2811 library.

Any help you can provide is VERY appreciated!
 
Hi, when I first have a new strip of leds I only test for RED first, and test all of the combinations. I use the following sketch.
Code:
#include <OctoWS2811.h>

const int ledsPerStrip = 50;

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];

const int config = WS2811_GRB | WS2811_800kHz;

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

void setup() {
  leds.begin();
  leds.show();
}

//for strip colour testing these are the permutations
/*
 * RGB
 * RBG
 * GRB
 * GBR
 * BGR
 * BRG
 */

#define RED    0xFF0000
#define GREEN  0x00FF00
#define BLUE   0x0000FF

void loop() {
 
  //test our led strip, run with just RED and test till you get red leds, then change this to word GREEN and upload, then to word BLUE and upload
for(int x=0;x<ledsPerStrip;x++){
 leds.setPixel(x, RED);
    leds.show();
    }
  delay(500);
}
 
Last edited:
Last time I looked BRG,BGR were not defined in octows2811.

All my led strips so far have been one of these. 12 strips (3 different types).

You have to change a bit of code in library if it's still the case.
 
Hi BRG and BGR were aded to octows28 library 4 months ago (fix #13). Is your teensyduino version the latest?
 
I'm having the same problem. I've tried every combination possible, but can't get the color output to match the code when I run the following sketch.
Code:
#include <OctoWS2811.h>

const int ledsPerStrip = 50;

DMAMEM int displayMemory[ledsPerStrip*6];
int drawingMemory[ledsPerStrip*6];

const int config = WS2811_GRB | WS2811_800kHz;

OctoWS2811 leds(ledsPerStrip, displayMemory, drawingMemory, config);

void setup() {
  leds.begin();
  leds.show();
}

#define RED    0xFF0000
#define GREEN  0x00FF00
#define BLUE   0x0000FF

void loop() {
  int microsec = 2000000 / leds.numPixels();  // change them all in 2 seconds

  colorWipe(RED, microsec);
  colorWipe(GREEN, microsec);
  colorWipe(BLUE, microsec); 
}

void colorWipe(int color, int wait)
{
  for (int i=0; i < leds.numPixels(); i++) {
    leds.setPixel(i, color);
    leds.show();
    delayMicroseconds(wait);
  }
}
Entered color order -> displayed color order:

GBR -> GBR
GRB -> RBG
RBG -> BGR
BRG -> BRG
RGB -> BRG
BGR -> BRG

I'm using a Teensy 3.2 with an OctoWS2811 and Arduino 1.8.3 with Teensy Loader 1.37, which I installed yesterday (29-6-17)
 
Last edited:
Status
Not open for further replies.
Back
Top