Multiple LED Sequences using 74HC595 and a Button

Hello, I am new to Arduino and while trying out a tutorial that came with a kit, I had an idea that I could make different sequences light up by pressing a button. There are no errors, but it isn't exactly doing what I wanted. It isn't controlled by the button at all and instead just does the first sequence(supposed to be activated by pressing the button once) repeatedly. The code is below.

int latchPin = 4;//Pin 12 (RCLK) of the shift register to pin 4 on the Arduino – this will be referred to as the “latch pin”
int clockPin = 3;//Pin 11 (SRCLK) of the shift register to pin 5 on the Arduino – this will be referred to as the “clock pin”
int dataPin = 2;//Pin 14 (SER) of the shift register to pin 2 on the Arduino – this will be referred to as the “data pin”
int buttonPin = 7;
byte leds = 0;//a variable called 'leds' is defined. This will be used to hold the pattern of which LEDs are currently turned on or off. Data of type 'byte' represents numbers using eight bits. Each bit can be either on or off, so this is perfect for keeping track of which of our eight LEDs are on or off.
byte leds2 = 7;
int currentLED = 0;
int currentLED2 = 0;
int buttonToggle = 0;

void setup()
{
  //The 'setup' function just sets the three pins we are using to be digital outputs.
  pinMode(latchPin, OUTPUT);
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  pinMode(buttonPin, INPUT_PULLUP);

  leds = 0;
  leds2 = 7;
  buttonToggle = 0;
}

void loop() {

  if (digitalRead(buttonPin) == LOW) {

    buttonToggle++;

  }

  else if (buttonToggle = 5) {

    buttonToggle = 0;

  }

  if (buttonToggle = 1) {

    leds = 0;

    if (currentLED == 7) {

      currentLED = 0;

    }
    else {

      currentLED++;
    }

    bitSet(leds, currentLED);

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, leds);
    digitalWrite(latchPin, HIGH);

    delay(250);

  }

  else if (buttonToggle = 2) {

    leds = 0;

    if  (currentLED == 7) {

      currentLED = 0;

    }

    else {

      currentLED++;

    }


    bitSet(leds, currentLED);

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, leds);
    digitalWrite(latchPin, HIGH);

    if (currentLED2 == 0) {

      currentLED2 = 7;

    }

    else {

      currentLED2 = -currentLED + 7;

    }

    bitSet(leds, currentLED2);

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, leds);
    digitalWrite(latchPin, HIGH);

    delay(250);

  }

  else if (buttonToggle = 3) {

    if (leds == 7) {

      leds = 0;

    }

    else {

      leds++;

    }
    if (currentLED == 6) {

      currentLED = 0;

    }
    else {

      currentLED++;
    }

    bitSet(leds, currentLED);

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, leds);
    digitalWrite(latchPin, HIGH);

    delay(150);

  }

  else if (buttonToggle = 4) {

    digitalWrite(latchPin, LOW);

  }

  delay(100);

}

Happy_Boyo:
There are no errors, but it isn't exactly doing what I wanted.

What do you want it to do?

Happy_Boyo:
I had an idea that I could make different sequences light up by pressing a button.

This

So, if it doesn't do that exactly, what does it do?

Happy_Boyo:
it isn't exactly doing what I wanted. It isn't controlled by the button at all and instead just does the first sequence(supposed to be activated by pressing the button once) repeatedly.

That

  else if (buttonToggle = 5) {

I'm not sure how many other places you did this, but you need this instead:

  else if (buttonToggle == 5) {

(oh, I see it all over the place...)

Thank you, this works great now, do you mind telling me the difference between "=" and "=="? Also, how would I turn off the lights? The current digitalWrite(latchPin, LOW); doesn't work

Happy_Boyo:
Thank you, this works great now, do you mind telling me the difference between "=" and "=="?

A useful page to bookmark.

Happy_Boyo:
Also, how would I turn off the lights?

    shiftOut(dataPin, clockPin, LSBFIRST, 0);

Thank you.

Update: The light switching works, but when I activate the second light combination, it lights them in the order: LED1, LED2 + LED3, LED2 + LED4 + LED5, LED4 + LED6 + LED7, LED6 + LED 8, it then repeats the process. My goal was to have it be like a wave so it would be "LED1 + LED8, LED2 + LED7, LED3 + LED6, LED4 + LED5, and so on. I'm not sure what it's doing, please explain.

leds = 0;

    if  (currentLED == 7) {

      currentLED = 0;

    }

    else {

      currentLED++;

    }


    bitSet(leds, currentLED);

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, leds);
    digitalWrite(latchPin, HIGH);

    if (currentLED2 == 0) {

      currentLED2 = 7;

    }

    else {

      currentLED2 = -currentLED + 7;

    }

    bitSet(leds, currentLED2);

    digitalWrite(latchPin, LOW);
    shiftOut(dataPin, clockPin, LSBFIRST, leds);
    digitalWrite(latchPin, HIGH);

    delay(250);