Button to Affect Another Variable (FastLED)

sterretje:
Connect a button between a pin and GND. In setup, use

pinMode (somePin, INPUT_PULLUP);

In loop, replace

 EVERY_N_SECONDS( 10 ) {

nextPattern();  // change patterns periodically
  }



by


if (digitalRead(somePin) == LOW)
  {
    delay(500);
    nextPattern();  // change patterns periodically
  }



It needs polishing but this should give you a start. The delay is there to prevent the code from going too fast if you keep the button pressed too long. You should study the state change detection example; if you implement the principle, you don't need the delay.

Brilliant! Thanks! Has worked perfectly. Will use the proper 'full code' soon. Thanks for you help!