So I am running the latest modified Electrodragon AT firmware and using the Arduino IDE. I am using the ESP8266WEBSERVER example and have some html buttons I made that use jquery to turn on a neopixel ring. Each button is for a different animation, for example Rainbow. I made functions with infinite while loops which call the animation functions. these are mapped with server.on() So when I hit a button, the animation starts but it gets caught in the infinite loop and the webserver hangs because of the loop.
How can I run these infinite loops in the background but accept another request for another animation? Basically I want to change animations and when changed have them loop infinitely until its changed again.