neopixel stick

Hi guys

I have been using the neopixels with adafruit lib.
Problem is i can address only 1 stick , how can i address diferent sticks at the same time on diferent pins? Thanks

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

There is a parameter in the constructor for the Neopixel object that requires you to define the pin being used and, of course, the secondobject must have a different name too.

The value in the code that is given gives me only #define PIN 6

So any order more i give in define would just replicate the code on that pin, how can i address it pin by pin? Or where can i find exaple code? Thank you

Declare a second Neopixel object with a different name and you can control them separately, but the code must not block and must return loop() frequently so that both sets of pixels can run in turn. That means no time consuming for loops or while loops and using millis() for timing instead of delay()

Neopixel sticks have a data-in and a data-out.
Can't you connect the data-in of the second stick to the data-out of the first one?
Leo..

Hi
Its for doing integrated turn lights thats why i need them to control separate, using IF for condition the leds

Thanks

Actually you don't need 2 sticks for that application. Suppose one turn indicator use LEDS 0 to 15 in a stick and the other uses LEDs 16 to 31 then you can control them separately

That is correct, but it will save me lots of wires..and it wouldnt harm to know how to get 2 pins or more to control individual sticks.
I looked up the .h file but cant see how to put more pins there.. what would be the setup and loop to define the neopixel pin and what command? Thank you

#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel stick1 = Adafruit_NeoPixel(16, 10, NEO_GRB + NEO_KHZ800);  //16 neopixels on pin 10
Adafruit_NeoPixel stick2 = Adafruit_NeoPixel(16, 11, NEO_GRB + NEO_KHZ800);  //16 neopixels on pin 11

void setup()
{
  stick1.begin();
  stick2.begin();
}

void loop()
{
  //code here to send data to stick1 or stick2 as required
}

Thanks. Thas a big help.
What are the numbers 16,10 and 16,11 reflecting? I only know to move around the adafruit neopixel "simple" thanks

Hi.
Look at this parameter.

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

Now look at what has been given to you;

Adafruit_NeoPixel stick1 = Adafruit_NeoPixel(16, 10, NEO_GRB + NEO_KHZ800);  //16 neopixels on pin 10
Adafruit_NeoPixel stick2 = Adafruit_NeoPixel(16, 11, NEO_GRB + NEO_KHZ800);  //16 neopixels on pin 11

Read the comment at the end of the two lines.
Tom.... :slight_smile:

Great, thanks!!! Will do some sketches