74hc595

so I'm using 74hc595 shift register to control 8 LEDs with arduino
I created 3 animations , which all work. I tried them all sepperately.
So I want to turn them one after another with a button using this example: https://www.arduino.cc/en/Tutorial/StateChangeDetection

It works like this: animation plays for 2 times and then all LEDs turn off, and only then, when I press a switch, It starts playing other animation for 2 times and then LEDs turn off...

How to fix it, so that animations would run without stopping?
here's the code:

galutis_shiferis.ino (1.91 KB)

AwFro:

for (int i = 0; i <= 5; i = 6)

{
...
}

Hm, if you want to execute the code block just once for "i=0", why do you write a for loop?

Wouldn't that be easier:

int i = 0;
...

Everything was right with the anations. I've already fixed my problems. It was with the button part.