Issues controlling independently 3 neopixel strips

Hi everyone,

I'm trying to control three noepixel strips of 6 pixels length each. I'm wiring each Din to its own arduino pin (D6,D5,D3) and power like the sketch below

5v batt ........| ......gnd batt......|
5v pin strips /|\ gnd pin strips /|
The issue that I'm having is that once I load the only one strips responds to the code and the other ones are one even if I set those pin unassigned

This is the code I'm using for testing.

#include <Adafruit_NeoPixel.h>
#define PIN 6

// 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)
Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(9, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(13, PIN, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip3 = Adafruit_NeoPixel(10, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  strip1.begin();
    strip2.begin();
      strip3.begin();


}


void loop(){
   // Some example procedures showing how to display to the pixels:
  colorWipe(strip1.Color(255, 0, 0), 50); // Red
  colorWipe(strip1.Color(0, 255, 0), 50); // Green
  colorWipe(strip1.Color(0, 0, 255), 50); // Blue\\
  
   colorWipe(strip2.Color(255, 0, 0), 50); // Red
  colorWipe(strip2.Color(0, 255, 0), 50); // Green
  colorWipe(strip2.Color(0, 0, 255), 50); // Blue
  
   colorWipe(strip3.Color(255, 0, 0), 50); // Red
  colorWipe(strip3.Color(0, 255, 0), 50); // Green
  colorWipe(strip3.Color(0, 0, 255), 50); // Blue


}

void colorWipe(uint32_t c, uint8_t wait) {
  for(uint16_t i=0; i<strip1.numPixels(); i++) {
      strip1.setPixelColor(i, c);
      strip1.show();
      delay(wait);
  }
    for(uint16_t i=0; i<strip2.numPixels(); i++) {
      strip2.setPixelColor(i, c);
      strip2.show();
      delay(wait);
  }
    for(uint16_t i=0; i<strip3.numPixels(); i++) {
      strip3.setPixelColor(i, c);
      strip3.show();
      delay(wait);
  }
}

I'm looking forward to your input
thank you

I just realized that I was changing the number of pixel no the pins . ....

Honestly, I've found the best results with neo pixels are when they are hooked into one long strip and using the library you can specify the size of the full matrix and the row grid layout.

But lets look at your code and problem :

#define PIN 6

  • So you have defined one PIN, as 6 and that's it.
    Then, in assignment
    Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(9, PIN, NEO_GRB + NEO_KHZ800);
    Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(13, PIN, NEO_GRB + NEO_KHZ800);
    Adafruit_NeoPixel strip3 = Adafruit_NeoPixel(10, PIN, NEO_GRB + NEO_KHZ800);

you are saying every strip is on the same pin? You're sending all the neo data out of the same pin- PIN #6 - instead out of different pins, hence one strip running. The pin number is the number of the output sending the serial data to the neopixels, so shouldn't you set them to D6,D5, and D3 respectively?

Also if you have 6 neo-pixels in 3 strips, why do you have 9, 13, and 10 for the number of neopixels? These should be 6,6,6.
If there are 6 neopixels in each strip, each of those values should be 6. Where are you getting 9,13, and 10? Are these the actual pin numbers you want?

Look carefully at the message format in your comments, because you're giving the neopixel library the wrong arguments and values and that seems to be the problem.

Good timing cochise. :stuck_out_tongue: