Hi guys/gals! Im new here so first off I want to say hello. Hello.

Hi guys/gals! Im new here so first off I want to say hello. Hello. :slight_smile: Secondly I’m trying to figure out how to code a fire2012 example with 5 different lengths of strips, specifically 41, 42, 45, 53 and 61 lengths. I’ve read the example guides but all I can sus out is the 60 pixel NUM_LEDS_PER_STRIP example and I have as you can see, different random lengths. My idea is to suspend them like icicles and encase them in poly tubes hanging down like a chandelier. Thanks a ton.

Are they on different pins or the same pin of your controller? If they’re on the same pin you’ll need to add the pixel counts together and offset by that much. If they’re on different pins you could just leave NUM_LEDS_PER_STRIP at the highest count (61) and let the extra data “fall out of” the last pixel in each strip.

They are in fact on different pins, 5 different pins. I’d like to be able to define the led numbers on each pin not only for this project but so I can fully understand the coding for later projects. I’d also not like the data to fall out because it seems to be more visually appealing when the strips are less uniformed /mirrored. Plus when the strips are eventually all hanging together, I’d like it to not be one big uniform blob but more of a dance. My idea is to have them hanging randomly spread apart, with a mass in the center of them all, sorta resembling a jelly fish.

By “fall out” I mean that the extra data beyond the last pixel in a string is simply discarded, since each LED will simply forward the bits received after it’s listened for its colour.

You have the option of creating one array for each pin or using a single array and offsetting the index for pixels in later strips (in your example, the first strip would be addressed by ledData[index], the second strip would be ledData[index + 41], the third would be ledData[index + 41 + 42] and so on).

Ok. Thanks.
Basically, in the fire2012 example, I’d like the shorter strips to do their own patters individually. So on the shorter strip, it isn’t simply a mirrored effect of the long one. Which would look better. Also the fire would fill the longer strip, and not overfill the shorter strips.

Then you’ll probably find it easier to have five separate arrays. To avoid repeating yourself in code, you’ll need to make sure the code that draws the pattern is in a function. You can then pass this function two arguments: a CRGB* pointer and an int. The pointer is the same type as the array (a C/C++ array is represented as a pointer to its first element) which you would provide as the first argument, and the int is the length of that array. You can then use these parameters to vary the way the drawing code works (eg. by replacing a NUM_LEDS with your new length integer).