0

how to address chained Neopixels
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

how to address chained Neopixels

by F4u5T on Wed Mar 06, 2019 5:42 pm

Lets say I have 3 16 LED Neopixel Rings wired daisy chain.

when I code them like :
Code: Select all | TOGGLE FULL SIZE
#define PIN      4
#define N_LEDS 39
Adafruit_NeoPixel front_Neopixels = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);


I know N_LEDS will work with the total number of leds, but is there a way for me to logically separate the rings - by the individual pixel locations to simplify programming?
or is it recommended just to runs another signal to each ring?

F4u5T
 
Posts: 63
Joined: Mon Dec 28, 2015 7:02 pm

Re: how to address chained Neopixels

by mbransom on Wed Mar 06, 2019 6:08 pm

I'm not aware of a built in way to separate the rings if they are connected through the same data port. But it's relatively easy to separate it out yourself in the code. You can create a separate array for each ring that contains it's RGB values, then just write a function that sends all those values to the right spots neopixels. If you need help with that I can give you some tips.

Separating the three rings to different pins would work fine, however it's important to know that the longer your data wires are, the more likely you will get interference and cause the LEDs to not display properly.

mbransom
 
Posts: 3
Joined: Tue Mar 05, 2019 4:09 pm

Re: how to address chained Neopixels

by Rassy on Wed Mar 06, 2019 6:17 pm

I have a question how many NeoPixels can I put on each pin on a circuit playground express? I am using silicone covered wire and a lithium ion battery. I want to do 40 NeoPixels total in my wearable project.

Rassy
 
Posts: 1
Joined: Wed Mar 06, 2019 6:08 pm

Re: how to address chained Neopixels

by adafruit_support_bill on Wed Mar 06, 2019 6:21 pm

The maximum number depends on the amount of memory available. Uness your code is extremely complex, 40 pixels should not be a problem.

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

Re: how to address chained Neopixels

by F4u5T on Wed Mar 06, 2019 6:23 pm

i found the array method and i think I'm on the right track...but any example would be appreciated

F4u5T
 
Posts: 63
Joined: Mon Dec 28, 2015 7:02 pm

Re: how to address chained Neopixels

by jim_lee on Thu Mar 07, 2019 5:56 am

I did it with a list of neoPixle objects. Each one is written as if its the only thing on the list. Makes it easy to use. Then, when you add them to the list, each offsets their addresses to match where they are on the list. I used this for a bunch of stuff and it works really well. But the one time I tried to share the code with someone from this forum, I think I melted his brain.

-jim lee

jim_lee
 
Posts: 532
Joined: Thu May 24, 2012 8:24 pm

Re: how to address chained Neopixels

by geekguy on Mon Aug 12, 2019 8:09 pm

F4u5T wrote:Lets say I have 3 16 LED Neopixel Rings wired daisy chain.

when I code them like :
Code: Select all | TOGGLE FULL SIZE
#define PIN      4
#define N_LEDS 39
Adafruit_NeoPixel front_Neopixels = Adafruit_NeoPixel(N_LEDS, PIN, NEO_GRB + NEO_KHZ800);

You have a total of 48 pixels.

F4u5T wrote:I know N_LEDS will work with the total number of leds, but is there a way for me to logically separate the rings - by the individual pixel locations to simplify programming?
or is it recommended just to runs another signal to each ring?

I have been doing exactly this! I can separate any length Neopixel strip into smaller sub strips and handle them separately. I have 12 pixel and 16 pixel rings chained now. You can find my stuff, including code, in this thread.

8-Dale

geekguy
 
Posts: 225
Joined: Tue Sep 10, 2013 2:43 pm
Location: Beaverton, OR

Please be positive and constructive with your questions and comments.


cron