issue calibrating the RGB order for my led strip

ey!!

I bought a cheap and very unusual WS2811 in ebay. http://www.ebay.com/itm/5M-30-Pixel-WS2811-IC-150-SMD-5050-RGB-Magic-Color-LED-Strip-DC12V-Waterproof/281261795832?_trksid=p2050601.m2372&_trkparms=aid%3D111000%26algo%3DREC.CURRENT%26ao%3D1%26asc%3D207%26meid%3D5412214385873098353%26pid%3D100085%26prg%3D1112%26rk%3D1%26rkt%3D4%26sd%3D281261795832%26%26clkid%3D5412216028195577415&_qi=RTM1562569

The strip works with 12V, and I am using a 1200mA power supply so far, which seems to be enough so far. I´ve tried it with the strandtest.ino sketch, the RGBCalibrate from the "fastled" library, and my own sketch.

Also the strip is not fully addressable. Color is only controllable in groups of three LEDs.

Now I am facing the following problem: I am using the "RGBCalibrate" sketch from the "fastled" library, and I have identified that the right order for the leds to display the colours correctly is "BRG", but when I try to change it in my sketch, which uses "Adafruit_NeoPixel.h" library, the IDE tells me that "ws2811:59: error: 'NEO_BRG' was not declared in this scope". Apparently this configuration is not declared in the library.

I attach here my sketch and the library´s files. perhaps it is fairly easy to declare this configuration in the library.

THANKS!

ws2811.ino (15.3 KB)

Adafruit_NeoPixel.cpp (36.6 KB)

Adafruit_NeoPixel.h (2.71 KB)

It's fairly easy to change the library to support the color scheme you want. You just have to adapt the two setPixelColor and the getPixelColor methods.

It really sound very easy! but definitely not very easy for me. I am just starting with arduino and code.

would you like to help me?

This should do the job, but I didn't insert the different versions, it's just BRG now.

// Set pixel color from separate R,G,B components:
void Adafruit_NeoPixel::setPixelColor(
 uint16_t n, uint8_t r, uint8_t g, uint8_t b) {
  if(n < numLEDs) {
    if(brightness) { // See notes in setBrightness()
      r = (r * brightness) >> 8;
      g = (g * brightness) >> 8;
      b = (b * brightness) >> 8;
    }
    uint8_t *p = &pixels[n * 3];
    *p++ = b;
    *p++ = r;
    *p = g;
  }
}

// Set pixel color from 'packed' 32-bit RGB color:
void Adafruit_NeoPixel::setPixelColor(uint16_t n, uint32_t c) {
  if(n < numLEDs) {
    uint8_t
      r = (uint8_t)(c >> 16),
      g = (uint8_t)(c >>  8),
      b = (uint8_t)c;
    if(brightness) { // See notes in setBrightness()
      r = (r * brightness) >> 8;
      g = (g * brightness) >> 8;
      b = (b * brightness) >> 8;
    }
    uint8_t *p = &pixels[n * 3];
    *p++ = b;
    *p++ = r;
    *p = g;
  }
}

// Query color from previously-set pixel (returns packed 32-bit RGB value)
uint32_t Adafruit_NeoPixel::getPixelColor(uint16_t n) const {

  if(n < numLEDs) {
    uint16_t ofs = n * 3;
    return (uint32_t)(pixels[ofs + 0]) |
        ((uint32_t)(pixels[ofs + 2]) <<  8) |
        ((uint32_t)(pixels[ofs + 1]) << 16)
      ;
  }

  return 0; // Pixel # is out of bounds
}

When you initialize your strip do it like this:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, stripPIN, NEO_GRB + NEO_KHZ800);

and not this:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(40, stripPIN, NEO_RGB + NEO_KHZ800);

PYLON!

that did the job! super danke. I will study it now to understand what happened.

THANK YOU SO MUCH!

inventorArtist:
When you initialize your strip do it like this:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, stripPIN, NEO_GRB + NEO_KHZ800);

and not this:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(40, stripPIN, NEO_RGB + NEO_KHZ800);

I am actually initializing it like this:

Adafruit_NeoPixel strip = Adafruit_NeoPixel(150, 31, NEO_RGB + NEO_KHZ400);

and I need to do it in BRG.-I think you are in another skecth! anyway, it is sorted now. thanksss!!!