#include <FastLED.h>
#define BRIGHTNESS 64
#define NUM_LEDS 32
#define LED_PIN 5
#define CHIPSET WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness(BRIGHTNESS);
}
int offset = 0;
void loop() {
for(int i = 0; i < NUM_LEDS; ++i) {
leds[i%NUM_LEDS] = ColorFromPalette(RainbowColors_p, (i + offset) * 255 / NUM_LEDS % 255);
}
offset++;
offset %= NUM_LEDS;
FastLED.show();
delay(30);
}