Hi all, I'm looking for some help retrofitting Fire2012WithPalette to work in a 2D

gplus
(Bill Goodrich) #1

Hi all, I’m looking for some help retrofitting Fire2012WithPalette to work in a 2D manner with alternating LED strands of varied lengths.

In my initial example, I have a test setup with the following lengths defined like this:

uint8_t numStrands = 6;
uint16_t startPixel[6] = {0,19,37,55,73,84};
uint16_t endPixel[6] = {13,32,50,68,79,90};

My code is located here:

When I load it up it performs some glitchy effect similar to Fire2012 and then hangs up (stops animation, but Photon still breathing cyan, etc.).

In principle, my approach seems like it would work but I can’t catch what is messing things up for me.

Has anyone worked with Fire2012 in this manner? I found some examples, but they split a strand into equal parts and that will not work for me as my strand lengths need to be individually defined.

Any insight much appreciated. Thanks in advance.

(Dougal Campbell) #2

All I see immediately is in setColorAndDelay(), you have a ‘<=‘ comparison in your for() loop that I think should just be ‘<‘.

(Bill Goodrich) #3

Thanks for that, Dougal.