#include <Adafruit_NeoPixel.h>

#define PIN        2  // Neopixel data pin
#define NUMPIXELS 256  // Total number of pixels in the matrix

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define BUTTON_PIN 9  // Pin for the button

// Function declarations
void patternOne();
void patternTwo();
void patternThree();

// Current pattern index
int currentPattern = 0;

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP); // Set button pin as input with internal pull-up resistor
  pixels.begin();  // Initialize Neopixel matrix
}

void loop() {
  if (digitalRead(BUTTON_PIN) == LOW) {
    // Button is pressed, switch to the next pattern
    currentPattern = (currentPattern + 1) % 3;
    delay(200); // Debouncing delay
  }

  // Execute the current pattern
  switch (currentPattern) {
    case 0:
      patternOne();
      break;
    case 1:
      patternTwo();
      break;
    case 2:
      patternThree();
      break;
  }
}

// Define your patterns here
void patternOne() {
  // Code for pattern one
}

void patternTwo() {
  // Code for pattern two
}

void patternThree() {
  // Code for pattern three
}