#include <FastLED.h>
#define LED_PIN 18    // LED串连接的引脚
#define NUM_LEDS 16   // LED数量
CRGB leds[NUM_LEDS];  // 用于存储LED颜色数据的数组
void setup() {
  // put your setup code here, to run once:
  FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);  // 初始化LED串

  Serial.begin(115200);
}

void loop() {
  // put your main code here, to run repeatedly:
  //紫色
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(160, 255, 255)));
  FastLED.show();
  Serial.println("紫色");
  delay(2000);
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(180, 255, 255)));
  FastLED.show();
  Serial.println("靛色");
  delay(2000);
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(192, 255, 255)));
  Serial.println("蓝色");
  FastLED.show();
  delay(2000);
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(96, 255, 255)));
  FastLED.show();
  Serial.println("绿色");
  delay(2000);
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(32, 255, 255)));
  FastLED.show();
  Serial.println("黄色");
  delay(2000);
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(24, 255, 255)));
  FastLED.show();
   Serial.println("橙色");
  delay(2000);
  fill_solid(leds, NUM_LEDS, CRGB(CHSV(0, 255, 255)));
  FastLED.show();
  Serial.println("红色");
  delay(2000);
}
