Problems with my attachInterrupt coding

Can someone point me in the right direction as to why my interrupts do not work while my code
that is running is in a delay ?

If I set my delays to a short time period I can see that the ISR is working to change my delay time.

I am Using a Mega board trying to use 4 Buttons to set the delay time “starDelay” to a time of
1 Second, 10 Seconds, 20 Seconds or 10 Minutes ( Those values will change later )

If I hold the pin low it will eventually change the delay as needed but it has to finish the current delay time first.

I know my Neopixel code is odd but it works great for my Fiber optic Shooting Stars as it is
it fires randomly as I need Just need to be able to change the delay time between firing instantly


Shooting_Star_SS_Only_Rev3.ino.ino (42.2 KB)

I believe that the delay() functions involves interrupts of its own. I've had lots of troubles combining interrupts with the delay function.

I have, however, used a timer to create my own 2000 Hz. clock, and the interrupts don't seem to be incompatible with the timers.

void loop()
   mode1 = random(sizeof(Star)/sizeof(char*));
   delay(starDelay); //  Delay Time between Random Star Fireing

Re-code without using delay.

Don't use delay(). The demo Several Things at a Time illustrates the use of millis() to manage timing.