Loop not looping - or is it? LED Sketch

Hi everyone!

I believe I am using the loop() function correctly but I am not sure if it is working? My sketch is below. Basically, I want the LED strip to shut off after it is completely lit, but it seems the lights just stay on and do nothing after they have completed the instructions. I am very new to this so I apologize if this is a simple error. Any help is greatly appreciated!

Best,
Olivia

#include <FastLED.h>
#define LED_PIN 4
#define LED_PIN2 5
#define NUM_LEDS 152
CRGB leds[NUM_LEDS];

void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.addLeds<WS2812, LED_PIN2, GRB>(leds, NUM_LEDS);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);

}
void loop() {
leds[0] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[1] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[2] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[3] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[4] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[5] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[6] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[7] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[8] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[9] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[10] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[11] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[12] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[13] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[14] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[15] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[16] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[17] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[18] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[19] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[20] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[21] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[22] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[23] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[24] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[25] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[26] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[27] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[28] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[29] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[30] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[31] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[32] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[33] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[34] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[35] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[36] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[37] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[38] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[39] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[40] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[41] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[42] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[43] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[44] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[45] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[46] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[47] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[48] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[49] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[50] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[51] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[52] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[53] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[54] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[55] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[56] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[57] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[58] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[59] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[60] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[61] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[62] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[63] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[64] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[65] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[66] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[67] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[68] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[69] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[70] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[71] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[72] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[73] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[74] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[75] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[76] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[77] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[78] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[79] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[80] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[81] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[82] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[83] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[84] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[85] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[86] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[87] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[88] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[89] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[90] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[91] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[92] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[93] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[94] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[95] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[96] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[97] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[98] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[99] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[100] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[101] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[102] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[103] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[104] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[105] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[106] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[107] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[108] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[109] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[110] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
leds[111] = CHSV(0, 0, 75);
FastLED.show();
delay(3000);
}

Trust me, loop() loops. This would have saved you some typing:

#include <FastLED.h>
#define LED_PIN     4
#define LED_PIN2    5
#define NUM_LEDS    152
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.addLeds<WS2812, LED_PIN2, GRB>(leds, NUM_LEDS);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
}

void loop() {
  for (int i = 0; i <= 111; i++)
  {
    leds[i] = CHSV(0, 0, 75);
    FastLED.show();
    delay(3000);
  }
}

The reason the LEDs don’t turn off, is because you don’t have any code to turn them off.

Thank you so so much for this! I knew there was a way to condense the type, but I did not yet know HOW to actually accomplish this, so I appreciate the help immensely.

Do you know by any chance how to shut them off? I feel like I am overcomplicating switching the LED strip off, but everything I have tried is not working. I tried using digitalWrite on LOW but nothing happened?

And if you want to turn them off and stay off:

#include <FastLED.h>
#define LED_PIN     4
#define LED_PIN2    5
#define NUM_LEDS    152
CRGB leds[NUM_LEDS];

void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
  FastLED.addLeds<WS2812, LED_PIN2, GRB>(leds, NUM_LEDS);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
}

void loop() {
  for (int i = 0; i <= 111; i++)
  {
    leds[i] = CHSV(0, 0, 75);
    FastLED.show();
    delay(3000);
  }
  for (int i = 0; i <= 111; i++)
  {
    leds[i] = CHSV(0, 0, 0);
  }
  FastLED.show();
  while(1);
}

Thank you so much! This was really helpful... I see now that it's a matter of simply turning them off via CHSV. I also played with it a bit and got it all to loop! I appreciate the help!