Neopixel Newb Q

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
JEBariffic
 
Posts: 15
Joined: Thu Sep 18, 2014 10:48 pm

Neopixel Newb Q

Post by JEBariffic »

Sure this is something dumb, but I can't get my neopixel strand to change colors as expected.

When I pass a single 255 value to the allOneColor function, I get the color expected:
255, 0, 0 makes the strip red
0, 255, 0 makes the strip green
0, 0, 255 makes the strip blue

But any time I put a value in the red position, the green and blue values are ignored
100, 255, 0 makes the strip light red, as if it were as 100, 0, 0 (no green shows)
100, 0, 255 again light red, as if 100,0,0 (no blue)

Leaving red at 0, the blue and green are funky as well:
0, 100, 255 makes the strip mostly green, although a little blue is present

This is driving me nuts. Any insight would be appreciated.



Code: Select all

#include <Adafruit_NeoPixel.h>

#define PIN 6

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

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

void loop() {
  allOneColor(strip.Color(0, 255, 0));
}


// Function to change all LEDs to specified color
void allOneColor(uint32_t c) {
  for(int i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c);
  }
  strip.show();
}

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: Neopixel Newb Q

Post by Franklin97355 »

How are you powering the strip and how are you connecting it to the micro? Power and connections are the major reasons for failures to work as expected, software is next. Have you run the strandtest sketch yet?

User avatar
JEBariffic
 
Posts: 15
Joined: Thu Sep 18, 2014 10:48 pm

Re: Neopixel Newb Q

Post by JEBariffic »

I'm connected as per the Uberguide, complete with capacitor and resistor as prescribed:
https://learn.adafruit.com/adafruit-neo ... no-library

Franklin, I ran the strandtest, then went back to my code and everything is working dandy.

No idea what I could have done, but thanks, Franklin, for the assist!

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”