hello everyone. longtime listener, first time caller.

hello everyone. longtime listener, first time caller. i’m having a little trouble modifying the FastLED “Demo with Button” sketch to do what i want. this is going to be for an illuminated costume that i want to be able to change not only the patterns on, but also when possible the parameters for hue, brightness(V), and speed. i’m using a trio of pots to do this on a Teensy 3.2. It is all working great, but I can’t get the function I added to break out of the loop on button press unless I time the press just right at the end of one of the internal loops. I know WHY this is happening, but I can’t figure out a workaround.

Also, I’m curious which parameters in the other functions I should assign to the pots in order to vary speed/hue/brightness the same way I did on the HSV calls in my “cylon” version.

Please be kind, this is my first foray into programming since the early 90’s. Thanks to anybody who can offer some hints.
http://pastebin.com/r85adbWn

@kevin_althans Erin St Blaine put together a nice tutorial

hey @Juergen_Bruegl , thanks for the tip. it looks very similar to what i’m doing, except all her functions are called without any nested loops which prevent the button from incrementing the program. i guess the only thing i can do is to put a button check inside the loop and be ok with it eating cycles.

@kevin_althans if you could switch over to APA102 you could use interrupts. Then nested loops are no problem

I’ve got a similarly hacked up demo reel with button, it’s not pretty, but it might help you. I’d become familiar with EVERY_N_MILLISECONDS_I, for non blocking delays. And the Fade to black function. https://github.com/shauneccles/Arduino-LED-Projects/blob/master/ShaunScarfProject/src/ScarfCode94LED.cpp

@Shaun_Eccles-Smith that is EXACTLY the functionality I was looking for! You completely made my day! Thank you!