#define LED_PIN 5
#define LED_NUM 8
#include "FastLED.h"
CRGB leds[LED_NUM];
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, LED_NUM);
FastLED.setBrightness(50);
}
byte counter = 0;
int8_t dir = 1;
void loop() {
FastLED.clear();
leds[counter] = CRGB(255, 200, 0);
FastLED.show();
counter+=dir;
if ((counter == LED_NUM-1) || (counter == 0)) dir=-dir;
delay(200);
}