pulse code for leds

I am using ws2812b's, an arduino uno and a button.

I need the light strip to get a pulse of light to go down and then back up the strip every time the button is pressed and have this continue in a loop. every time the button is pressed a new pulse starts while the previous pulse stays

eg: button pressed --> light pulse goes up and down strip --> button pressed again --> now there are two pulses on the strip.

I undertsand that I have to set a limit on the amount of pulses which can run before a reset but am fine with what ever the max is and do not know how to determine what it will be.

I was going to use if and for loops but i found a code i think i can use if i modify it using the fastled library:

#include<FastLED.h>
#define NUM_LEDS 30
#define SCROLL_SPEED 50

CRGBArray<NUM_LEDS> leds;

int INpin = 7;
int input = 0;
unsigned long lastUpdate;

void setup() {
FastLED.addLeds<NEOPIXEL, A0>(leds, NUM_LEDS);
pinMode(INpin, INPUT);
}

void loop() {

input = digitalRead(INpin);
if (input == HIGH)
leds[0] = CRGB::Blue;
else
leds[0] = CRGB::Black;

if (millis() - lastUpdate > SCROLL_SPEED) {
lastUpdate += SCROLL_SPEED;
for (int i = NUM_LEDS - 1; i > 0; i--)
leds = leds[i - 1];
FastLED.show();
}
}

Does anyone have any suggestions of how I should modify it.

I am very new to coding and the project is due soon so any advice/help would be extremely appreciated.

I am very new to coding and the project is due soon so any advice/help would be extremely appreciated.

You have the pin mode set to INPUT. This means that you need an external pullup or pulldown resistor wired with the switch. Do you? How IS the switch wired?

You read the state of the pin that the switch is wired to, and do something if the pin is HIGH. I suspect that you want to do something if the pin HAS BECOME HIGH, not IS HIGH. The state change detection example bears looking into.

      leds = leds[i - 1];

You can't have an array on the left of an = sign. An array element, yes. An array, no.

You need to define what a "pulse" means to you. You need to define what having more than one of them means. You need to define what "up and down the strip" means. How many LEDs are to be on at once, per "pulse", would be the minimum you need to define.