0

NeoPixel Jewel Lib Wrong Colors
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

NeoPixel Jewel Lib Wrong Colors

by vl_martin on Sat Apr 14, 2018 7:45 am

Hello,

I've connected a NeoPixel Jewel to a Trinket M0 and used the example jewel-hair-stick to test it, but the library fails - it doesn't produce the correct colors, overlaps the pixels if I use setPixelColor... If I define 7 as the number of pixels to use the last pixel is always off.

I've played around a bit and it seems that it doesn't really forward the colors correctly, only pixel 0 is working correctly (if I decide to only use that pixel). I used the following code to test the jewel, uploaded screenshots too:

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_NeoPixel.h>

#define PIN 4
#define NUMPIXELS 7

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

uint32_t test [] = {
  strip.Color(255,   0,  0),
  strip.Color(  0, 255,  0),
  strip.Color(  0,   0,255)};

void setup() {
  strip.begin();
  strip.setBrightness(30);
  strip.show(); // Initialize all pixels to 'off'
}

int i, j = 0;

void loop()
{
  for (i = 0; i < NUMPIXELS; i++)
  {
    strip.setPixelColor(i, test [j]);
  }
  j++;
  if (j >= 3)
  {
    j = 0;
  }
  strip.show();
  delay(3000);
}


photos of each step:
https://ibb.co/hsxBmn
https://ibb.co/h6mtz7
https://ibb.co/nRkQCS

Am I missing something here?

vl_martin
 
Posts: 7
Joined: Tue Apr 03, 2018 3:18 am

Re: NeoPixel Jewel Lib Wrong Colors

by adafruit_support_bill on Sat Apr 14, 2018 9:46 am

Looks like you may have one of the RGBW jewels. In that case, you need to change

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

to

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRBW + NEO_KHZ800);

adafruit_support_bill
 
Posts: 70386
Joined: Sat Feb 07, 2009 10:11 am

Re: NeoPixel Jewel Lib Wrong Colors

by vl_martin on Sat Apr 14, 2018 2:46 pm

my very bad - should have known better ... did the trick - thanks a lot !

vl_martin
 
Posts: 7
Joined: Tue Apr 03, 2018 3:18 am

Re: NeoPixel Jewel Lib Wrong Colors

by adafruit_support_bill on Sat Apr 14, 2018 3:15 pm

Good to hear it is working. Thanks for the follow-up.

adafruit_support_bill
 
Posts: 70386
Joined: Sat Feb 07, 2009 10:11 am

Please be positive and constructive with your questions and comments.