#include <FastLED.h>    // FastLED Declare the FastLED library

#define LED_PIN 6       // Define the WS2812 RGB lamp pin
#define NUM_LEDS 12     // Define the number of beads
#define BRIGHTNESS 64   // Set the light level from 0 to 255, with the higher the light

CRGB leds[NUM_LEDS];    //An array of CRGB type with length NUM_LEDS is instantiated to control the WS2812B LED strip

void setup() {
  FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);  // Use the NEOPIXEL type
  FastLED.setBrightness(BRIGHTNESS);                   // Initialize the light level
}

void loop() {
  // Light the leds one by one to show green
  for (int i = 0; i < NUM_LEDS; i++) {
    fill_solid(leds, NUM_LEDS, CRGB::Black);  // Turn off all leds
    leds[i] = CRGB::Green;                    // Light only the current LED
    FastLED.show();
    delay(100);
  }
}
