Multiple Strips with Pushbutton Support

Hi Everyone,

Kind of new to the forums and if this post does not belong here, I apologize. I am looking for some guidance on code and what I may be doing wrong.

I am trying to build out some LED lights for a friends costume. It is actually the fin for Yondu from Guardians of the Galaxy. I think I have most of it down, but I am running into some issues, and I am not quite sure what to do.

The code is set to run multiple NeoPixel Strips. As the Arduino does one task at a time, the folks at Adafruit put together a guide on how to multi-task with these strips. My take on it is, that you are basically deconstructing loops, and increment them step by step.

The issues I am running into:

I am using a case/switch statment. My statement is being executed on every pass through the loop, so I am re-initializing the pixel state machines on every pass. I want to execute that statement only once per button press. I put in some logic to try to do that, but it may not be working quite right.

There is a vlaue "Interval" that is supposed to be the Millisecond (Millis) delay and I can't seem to get that functioning correctly either. I also don't know if i need to make a "Complete" command like the adafruit folk did in their example

Lastly, once I cycle through the 3 case statements, my button pushes don't seem to register, but eventually they do. I don't know if I am stuck in a loop/function or if it is a debounce issue..

The folks at Adafruit have a guide here: Overview | Multi-tasking the Arduino - Part 3 | Adafruit Learning System

Attached below

I also tried a different approach, In this one I can get the Red Lights to power on, but they are not lighting up one at a time until fully lit like they do with the normal "ColorWipe" function. The effect I was going for was like a light saber. Generally you can set a delay and it works.

the animation on button press is the one I want. Where one is doing a scanner motion and one is solid red. I would optimally like it to keep running that pattern not just run it when the button is pushed.

Finally I was trying to add a third step (when you hit the button a second time) that reverses the ColorWipe to black, like turning off a light saber.

Pushbutton_Fin.ino (11.5 KB)

Most mobile devices can not cope with .ino files. Read the how to use the forum sticky post and post your code correctly for this forum.