SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By shawt
#200932
Hi I just got a bunch of 12999 and they seem to work fine with the Adafruit Neopixel library with one exception. When I send it an RGB value, the R and G values seem to be reversed.

Any idea what might be going wrong here? The code below should be turning my two LEDs Red, but instead they are turning green. If I use the color value 0,255,0 I get two red LEDs.
Code: Select all
#include "Adafruit_NeoPixel.h"

Adafruit_NeoPixel pixels_4(2, 4);
int max_leds = 2;
void setup()
{
  pixels_4.begin();
pixels_4.show();

}


void loop()
{
  for(int x = 0; x< max_leds; x++){
       pixels_4.setPixelColor(x, 255, 0, 0);
  };
  pixels_4.show();
  delay(100);

}
User avatar
By darrellg
#200934
This note is in the strandtest example code:
Code: Select all
// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
//   NEO_KHZ800  800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
//   NEO_KHZ400  400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
//   NEO_GRB     Pixels are wired for GRB bitstream (most NeoPixel products)
//   NEO_RGB     Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
//   NEO_RGBW    Pixels are wired for RGBW bitstream (NeoPixel RGBW products)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(60, PIN, NEO_GRB + NEO_KHZ800);
Also, see https://learn.adafruit.com/adafruit-neo ... e?view=all