sync 2 or more strands of neopixel?

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
dfrhodes
 
Posts: 1
Joined: Fri Jul 11, 2014 3:24 pm

sync 2 or more strands of neopixel?

Post by dfrhodes »

Hi - i have a Mega controller and a single strand or Neopixel 60..what i would like to do though is to have 2 or 3 strands in parallel that are synchronized with each other.Can i do this with a single controller? or with one controller on different channels?

not sure if LED's are addressed differently in each strand or i need to do the sync in code somehow.

thanks

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: sync 2 or more strands of neopixel?

Post by adafruit_support_rick »

You can do that. Connect each strip to a different output pin.
Declare an instance of the Adafruit_NeoPixel object for each strand. For example:

Code: Select all

  Adafruit_NeoPixel strip1 = Adafruit_NeoPixel(60, PIN1, NEO_GRB + NEO_KHZ800);
  Adafruit_NeoPixel strip2 = Adafruit_NeoPixel(60, PIN2, NEO_GRB + NEO_KHZ800);
  Adafruit_NeoPixel strip3 = Adafruit_NeoPixel(60, PIN3, NEO_GRB + NEO_KHZ800);
Now you can write the same thing to each strip:

Code: Select all

    for(i=0; i< strip1.numPixels(); i++) {
      strip1.setPixelColor(i, 0, 0, 255);
      strip2.setPixelColor(i, 0, 0, 255);
      strip3.setPixelColor(i, 0, 0, 255);
    }
    strip1.show();
    strip2.show();
    strip3.show();
You can also make an array of Adafruit_NeoPixel objects. See this thread:
http://forums.adafruit.com/viewtopic.ph ... it=+strips

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

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