#include <FastLED.h>

#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() {
  // Gradients display different colors
  for (int hue = 0; hue < 255; hue++) {
    fill_rainbow(leds, NUM_LEDS, hue, 8);
    FastLED.show();
    delay(20);
  }
}
