Changing from delay() to "without delay()"

Hi Pady,

I can see that from that thread that Robin2 is helping you with that its hard to get your head around if you are a beginner!

How about this for a "quick & dirty" fix:

void myDelay(long t) {
  for (long i = 0; i<= t && digitalRead(buttonPin) == LOW; i++) {
    delay(1);
  }
}

Add this function to your sketch and then replace each of your calls to "delay(Time)" with "myDelay(Time)".

All it basically does is break down the long delays into a series of short ones, and checks for the button press before each one. So if the button is pressed, the delay cut short and which ever animation function is running, it finishes in less than the blink of an eye, so your sketch then returns to main() and can check the button properly.

I have not tested that, only checked that it compiles OK. Also you seem to have some strange extra braces in your sketch - "{" & "}" - you might want to double-check, for example in slowonalloff().

Paul