Anyone knows how to properly hook up Neopixels to an Arduino Due?

Also I use 100ohm resistors on the data lines rather than 220ohm with 3.3v controllers…

Ah! If I understand the example correctly, each strip is the same length. My project has strips of varying length, but I could work with using my longest strip as NUM_LEDS_PER_STRIP. My “octopus” has 40+ legs and is pretty asymmetrical (I’m teaming up with a glass blower to bring a big art piece to life :slight_smile:

The only problem I see is that my code is designed to use a two dimensional array like so :
CRGB leds[NumStrips][MaxLEDS];

instead of
CRGB leds[NumStrips*MaxLEDS];

Yes, I use this with asymmetrical strips too, just set the strip length to the longest size. It’s not memory efficient but on a Due or a Teensy 3.1/3.2 this is rarely a problem. Just remember to that some of the LEDs don’t actually exist when you write your code. (It doesn’t actually matter if do you write to them though.)

Right now, keep your two dimensional array, and when you do your add leds call, replace leds with ((CRGB*)leds) — this does a cast. In the meantime, I will add some code in place so that when you’re using the n-way output you can just pass a two dimensional array in without needing the cast.

@Daniel_Garcia
Awesome I’ll keep that in mind. I’m gonna stick with the Due since I already have it and work with level converters.

Will I be able to use the same 2d array and mix parallel and normal output? For example :
strips 0-6 on WS2811_PORTA
strips 7-14 on WS2811_PORTD
strips 15 and onwards on regular pins?

Yup! What you do is for the n-way addLeds, you give it the start of those strips, so for example:

addLeds<WS2811_PORTA….>(leds[0], MaxLEDS);
addLeds<WS2811_PORTD,…>(leds[7], MaxLEDS);
addLeds<WS2811,…>(leds[15], MaxLEDS);

etc…

assuming that your leds array is defined as CRGB leds[40][MaxLEDS] or some such. I’ll also see about whether or not I can get you some more/wider parallel outputs that you can use on the due. (This is where I insert a rant about being irritated about the semi-random, idiotic way in which ports and pins are exposed on arduino boards)

This will be a breeze to implement then. Thank you!

@Daniel_Garcia
Hey Daniel I’m ready to test this now. I have 10 Neopixel strips hooked to a Due with level converters. 100 Pixels each, so 1000 Neopixels. Running FastLED 3.1.0

I can’t get the addLeds to work. My setup works fine without parallel output though. I’m not sure I have the proper syntax :

FastLED.addLeds<WS2811_PORTD>(leds[0], TotalLEDS);
FastLED.addLeds<WS2811_PORTA>(leds[8], TotalLEDS);

I have 8 strips on PORTD and 2 on PORTA.

PS. This isn’t my final setup. Only a test circuit for now. The leds will be spread on more pins ultimately.

with parallel output you normally use

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

LEDS.addLeds<WS2811_PORTA,NUM_STRIPS>(leds, NUM_LEDS_PER_STRIP);

I know that your set up is more complicated, but try LEDS.addLeds rather than FastLED.addLeds

There is no difference between using LEDS.addLeds and FastLED.addLeds (LEDS and FastLED are aliases for each other). The way he is calling things is correct - it’s possible there’s something wrong with the due parallel output.

@Franck_Marcotte I will try to run some tests with the due parallel output code and make sure that it is still working.

(Also - what is the value of TotalLEDS? If the length of your strips is 100 - then that should be the value of TotalLEDS. If you are passing 1000 in there, then that is likely causing problems for you and your setup :slight_smile:

TotalLEDS is 100. If I can do anything to help testing, I’m available! Thank you

@Daniel_Garcia The more I think about parallel output, the more I realize how useful it will be for this project. Right now the powerful cpu of the Due allows me to run 10 independant animations on 10 strips of 100 leds in only ~10ms per pass. However at 30us per led for show() it takes ~30ms to write the leds. If I can reduce that time I can greatly improve the resolution of my animations.

I’ve been looking around for a Digix for future use to no avail, but I stumbled upon the Taijiuino Due R3. I’ve never heard of it before, but it unlocks 20 more pins and is almost identical to the Due. (http://www.elechouse.com/elechouse/index.php?main_page=product_info&cPath=72_73&products_id=2257)

According to their doc pins 92-109 are usable, maybe WS2811_PORTB or even 24-way would be feasible on this board!