How do I turn on all the leds of a stirp at the same time?

Hi everyone,
I am using the led strip WS2812B.
I have 60 LED and I want to turn all of them on at the same time.
So far, I can turn on the first one if I do this:

#include <FastLED.h>
#define LED_PIN     7
#define NUM_LEDS    60
CRGB leds[NUM_LEDS];
void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
 
    leds[1] = CRGB ( 0, 0, 255);
    FastLED.show();

 delay(1000);
 
    leds[1] = CRGB ( 255, 0, 0);
    FastLED.show();
    
 delay(1000);
  
}

Or, I can turn them on one at a time if I do this:

#include <FastLED.h>
#define LED_PIN     7
#define NUM_LEDS    60
CRGB leds[NUM_LEDS];
void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
  for (int i = 0; i <= 59; i++) {
    leds[i] = CRGB ( 0, 0, 255);
    FastLED.show();

  }
 delay(1000);
     
  for (int i = 59; i >= 0; i--) {
    leds[i] = CRGB ( 255, 0, 0);
    FastLED.show();

  }
 delay(1000);
  
}

How do I turn all of them on at the same time?

Thank you in advance for your time

You can do this by moving FastLED.show() outside the for loops.

If you want to get rid of the for loops altogether, you can make leds a CRGBArray:

#include <FastLED.h>
#define LED_PIN     7
#define NUM_LEDS    60
CRGBArray<NUM_LEDS> leds;
void setup() {
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
  leds = CRGB (0, 0, 255);
  FastLED.show();

  delay(1000);

  leds = CRGB (255, 0, 0);
  FastLED.show();

  delay(1000);

}

More information on that here:

Awesome, it worked =)

Also, thank you very much for the info page. Very useful.

You're welcome. I'm glad to hear it's working now. Enjoy!
Per