android buttons + arduino


I created an android app, and some void in arduino for my RGB led cube.
I want to control the voids with the buttons but i cant switch another animation because i hit the button for animation 1 and its run over and over because the loop. How can i stop the void and play another animation?
I try goto label but it isnt work. Any idea?

Let's start by getting the terminology right. What you are calling "voids" in your post are almost certainly functions. Function names are preceded by the type specifier of the data returned by the function. Using void indicates that no data is returned by the function.

It sounds like you have for loops and/or delay()s in your code which makes detecting input difficult because the code is busy doing something else (a for loop) or nothing at all (a delay()) or possibly both. You will need to change your method of timing so that it does not block the free execution of the code.

Please post a full program illustrating the problem.

Have a look at Using millis() for timing. A beginners guide, Several things at the same time and look at the BlinkWithoutDelay example in the IDE.