Code doesn't seem to make LED strip do anything

Hi, I appreciate you probably get a lot of this noob stuff so my apologies.
Basically, I’m still learning the basics of Arduino/C++, and I’m trying to make a car-indicator type deal.
I’m using an Arduino Mini Pro 3.3v, and I’m trying to use state change to log changes to pin 11 so that when pin 11 receives input, it activates the for loops, else it just goes to that one for loop. Code’s below

#include <FastLED.h>
#define LED_PIN     10
#define NUM_LEDS    30
CRGB leds[NUM_LEDS];
const int buttonPin = 11;

int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
  pinMode(buttonPin, INPUT);
}
void loop() {
  buttonState = digitalRead(buttonPin);
  if(buttonState != lastButtonState) {
    if (buttonState == HIGH) {
      for (int i = 0; i <= 30; i++) { //orange
        leds[i] = CRGB ( 255, 59, 0);
        FastLED.show();
        delay(10);
      }
      for (int i = 30; i >= 0; i--) { //red
        leds[i] = CRGB ( 255, 0, 0);
        FastLED.show();
        delay(10);
      }
      for (int i = 30; i>= 0; i--) {
        leds[i] = CRGB (255, 59, 0);
        FastLED.show();
        delay(10);
      }
      for (int i = 0; i>= 30; i--) {
        leds[i] = CRGB (255, 0, 0);
        FastLED.show();
        delay(10);
      }
    } else {
      for (int i = 0; i <= 30; i++) {
        leds[i] = CRGB (0, 0, 0);
        FastLED.show();
        delay(10);
      }
    }
  }
}

When I run the code though, all that happens is literally nothing. It doesn’t even change the LED’s previously lit from old code.
My question is am I going about this completely wrong? Like I said, I’m still very new to C++, so it’s most likely that my code is awfully messy and awry and my approach most likely wrong too, but any help would be appreciated :slight_smile:
Oh and I totally forgot, I’m using a WS2812 strip of 30 LED’s too.

The first thing to do is confirm that the problem is, in fact, the code and not the hardware setup. Did you trying running any of the examples that come with the FastLED library? Did they work?

Also, if you have 30 LEDs, then they are indexed 0 through 29. You don’t have an element #30. Writing to it like you do is corrupting memory that you don’t own.

gfvalvo: Also, if you have 30 LEDs, then they are indexed 0 through 29. You don't have an element #30. Writing to it like you do is corrupting memory that you don't own.

It's definitely the code, the examples run smoothly when I tried them. That could be the issue, I'll correct it and see what happens. Thank you!