user11765: I am trying to make a 24 button board that assigns different methods to each button. When a button is pressed, it should interrupt the method of the previous button and begin the new method. Currently, the button has to be held down in order to work. I'm not sure why since the methods should continue without being held down. All 24 methods are similar to the one posted below.
loop(){
  if (digitalRead(inPin(5)) == HIGH){
    fifthButtonTheatreChaseRedSlow(strip.Color(127,   0,   0), 100); // Red
  }

void fifthButtonTheatreChaseRedSlow(uint32_t c, uint8_t wait) {
  for (int j=0; j<100; j++) {  //do 100 cycles of chasing
    for (int q=0; q < 3; q++) {
      for (int i=0; i < strip.numPixels(); i=i+3)
      {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();
      delay(wait);

      // give up if switches pressed
      if (digitalRead (inPin(1)) == HIGH || 
             digitalRead (inPin(2)) == HIGH ||
             digitalRead (inPin(3)) == HIGH ||
             digitalRead (inPin(4)) == HIGH || 
             digitalRead (inPin(6)) == HIGH ||
             digitalRead (inPin(7)) == HIGH || 
             digitalRead (inPin(8)) == HIGH ||
             digitalRead (inPin(9)) == HIGH || 
             digitalRead (inPin(10)) == HIGH ||
             digitalRead (inPin(11)) == HIGH || 
             digitalRead (inPin(12)) == HIGH ||
             digitalRead (inPin(13)) == HIGH || 
             digitalRead (inPin(14)) == HIGH ||
             digitalRead (inPin(15)) == HIGH || 
             digitalRead (inPin(16)) == HIGH ||
             digitalRead (inPin(17)) == HIGH || 
             digitalRead (inPin(18)) == HIGH ||
             digitalRead (inPin(19)) == HIGH || 
             digitalRead (inPin(20)) == HIGH ||
             digitalRead (inPin(21)) == HIGH ||
             digitalRead (inPin(22)) == HIGH || 
             digitalRead (inPin(23)) == HIGH ||
             digitalRead (inPin(24)) == HIGH)
               return;

      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}

Not sure if it's a hardware issue or a software issue.

user4143: It's a software issue.  You are basically saying "If this button is currently pressed down then run this sequence once", rather than "If this button has transitioned from OFF to ON then set my current sequence to X"
You need to learn about the Finite State Machine and about switching from one state to another (or one selected sequence to another) when a button changes state not when it is in a state.
So basically the whole logic of your program is flawed and needs re-working.

user10794: Related to Multiple buttons activating different methods for an LED strip
 // give up if switches pressed
  if (digitalRead (inPin(1)) == HIGH || 
         digitalRead (inPin(2)) == HIGH ||
         digitalRead (inPin(3)) == HIGH ||
         digitalRead (inPin(4)) == HIGH || 
         digitalRead (inPin(6)) == HIGH ||
         digitalRead (inPin(7)) == HIGH || 
         digitalRead (inPin(8)) == HIGH ||
         digitalRead (inPin(9)) == HIGH || 
         digitalRead (inPin(10)) == HIGH ||
         digitalRead (inPin(11)) == HIGH || 
         digitalRead (inPin(12)) == HIGH ||
         digitalRead (inPin(13)) == HIGH || 
         digitalRead (inPin(14)) == HIGH ||
         digitalRead (inPin(15)) == HIGH || 
         digitalRead (inPin(16)) == HIGH ||
         digitalRead (inPin(17)) == HIGH || 
         digitalRead (inPin(18)) == HIGH ||
         digitalRead (inPin(19)) == HIGH || 
         digitalRead (inPin(20)) == HIGH ||
         digitalRead (inPin(21)) == HIGH ||
         digitalRead (inPin(22)) == HIGH || 
         digitalRead (inPin(23)) == HIGH ||
         digitalRead (inPin(24)) == HIGH)
           return;

Time to learn about loops, buddy. How about:
for (int i = 1; i <= 24; i++)
  if (digitalRead (inPin (i)) == HIGH)
    return;

My guess about this particular problem is that you are not debouncing. You enter the function, one of the bounces is detected, and you leave the function. I mentioned debouncing in your other, closely-related, thread.

Let me show you what a switch bounce looks like. Using a normal switch from my parts drawer, this is what you see when you press it:

See that? It looks to the (fast) Arduino that you pressed the switch 20 or 30 times. That is the physical metal bouncing back and forwards. So if you test for one press, and then stop when you get another, your chances of it working are rather slim. That's why a simple delay of (say) 10 ms after detecting a change in state of the switch can help debounce it.
See: Switches tutorial

11765: <p>I am trying to make a 24 button board that assigns different methods to each button. When a button is pressed, it should interrupt the method of the previous button and begin the new method. Currently, the button has to be held down in order to work. I'm not sure why since the methods should continue without being held down. All 24 methods are similar to the one posted below.</p>

<pre><code>loop(){
  if (digitalRead(inPin(5)) == HIGH){
    fifthButtonTheatreChaseRedSlow(strip.Color(127,   0,   0), 100); // Red
  }

void fifthButtonTheatreChaseRedSlow(uint32_t c, uint8_t wait) {
  for (int j=0; j&lt;100; j++) {  //do 100 cycles of chasing
    for (int q=0; q &lt; 3; q++) {
      for (int i=0; i &lt; strip.numPixels(); i=i+3)
      {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();
      delay(wait);

      // give up if switches pressed
      if (digitalRead (inPin(1)) == HIGH || 
             digitalRead (inPin(2)) == HIGH ||
             digitalRead (inPin(3)) == HIGH ||
             digitalRead (inPin(4)) == HIGH || 
             digitalRead (inPin(6)) == HIGH ||
             digitalRead (inPin(7)) == HIGH || 
             digitalRead (inPin(8)) == HIGH ||
             digitalRead (inPin(9)) == HIGH || 
             digitalRead (inPin(10)) == HIGH ||
             digitalRead (inPin(11)) == HIGH || 
             digitalRead (inPin(12)) == HIGH ||
             digitalRead (inPin(13)) == HIGH || 
             digitalRead (inPin(14)) == HIGH ||
             digitalRead (inPin(15)) == HIGH || 
             digitalRead (inPin(16)) == HIGH ||
             digitalRead (inPin(17)) == HIGH || 
             digitalRead (inPin(18)) == HIGH ||
             digitalRead (inPin(19)) == HIGH || 
             digitalRead (inPin(20)) == HIGH ||
             digitalRead (inPin(21)) == HIGH ||
             digitalRead (inPin(22)) == HIGH || 
             digitalRead (inPin(23)) == HIGH ||
             digitalRead (inPin(24)) == HIGH)
               return;

      for (int i=0; i &lt; strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}
</code></pre>

<p>Not sure if it's a hardware issue or a software issue.</p>
 4143: <p>It's a software issue.  You are basically saying "If this button is currently pressed down then run this sequence once", rather than "If this button has transitioned from OFF to ON then set my current sequence to X"</p>

<p>You need to learn about the <a href="http://hacking.majenko.co.uk/finite-state-machine" rel="nofollow">Finite State Machine</a> and about switching from one state to another (or one selected sequence to another) when a button <em>changes</em> state not when it is <em>in</em> a state.</p>

<p>So basically the whole logic of your program is flawed and needs re-working.</p>
 10794: <p>Related to <a href="https://arduino.stackexchange.com/questions/14320/multiple-buttons-activating-different-methods-for-an-led-strip">Multiple buttons activating different methods for an LED strip</a></p>

<pre><code> // give up if switches pressed
  if (digitalRead (inPin(1)) == HIGH || 
         digitalRead (inPin(2)) == HIGH ||
         digitalRead (inPin(3)) == HIGH ||
         digitalRead (inPin(4)) == HIGH || 
         digitalRead (inPin(6)) == HIGH ||
         digitalRead (inPin(7)) == HIGH || 
         digitalRead (inPin(8)) == HIGH ||
         digitalRead (inPin(9)) == HIGH || 
         digitalRead (inPin(10)) == HIGH ||
         digitalRead (inPin(11)) == HIGH || 
         digitalRead (inPin(12)) == HIGH ||
         digitalRead (inPin(13)) == HIGH || 
         digitalRead (inPin(14)) == HIGH ||
         digitalRead (inPin(15)) == HIGH || 
         digitalRead (inPin(16)) == HIGH ||
         digitalRead (inPin(17)) == HIGH || 
         digitalRead (inPin(18)) == HIGH ||
         digitalRead (inPin(19)) == HIGH || 
         digitalRead (inPin(20)) == HIGH ||
         digitalRead (inPin(21)) == HIGH ||
         digitalRead (inPin(22)) == HIGH || 
         digitalRead (inPin(23)) == HIGH ||
         digitalRead (inPin(24)) == HIGH)
           return;
</code></pre>

<p>Time to learn about loops, buddy. How about:</p>

<pre><code>for (int i = 1; i &lt;= 24; i++)
  if (digitalRead (inPin (i)) == HIGH)
    return;
</code></pre>

<p>My guess about this particular problem is that you are not debouncing. You enter the function, one of the bounces is detected, and you leave the function. I mentioned debouncing in your other, closely-related, thread.</p>

<hr>

<p>Let me show you what a switch bounce looks like. Using a normal switch from my parts drawer, this is what you see when you press it:</p>

<p><a href="https://i.stack.imgur.com/tr6LT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tr6LT.png" alt="Switch bounce"></a></p>

<p>See that? It looks to the (fast) Arduino that you pressed the switch 20 or 30 times. That is the physical metal bouncing back and forwards. So if you test for one press, and then stop when you get another, your chances of it working are rather slim. That's why a simple delay of (say) 10 ms after detecting a change in state of the switch can help debounce it.</p>

<p>See: <a href="http://www.gammon.com.au/switches" rel="nofollow noreferrer">Switches tutorial</a></p>
