#include <FastLED.h>
//https://github.com/FastLED/FastLED/wiki/Controlling-leds
#define NUM_LEDS 12
#define LED_PIN 3
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812B, LED_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(255);
leds[0].red = leds[0].green = leds[0].blue = 255;
FastLED.show();
delay(2500);
Serial.begin(115200); Serial.println("Start");
leds[0] = leds[3] = leds[6] = leds[9] = CRGB::Red;
FastLED.show();
delay(500);
leds[1] = leds[4] = leds[7] = leds[10] = CRGB::Green;
FastLED.show();
delay(500);
leds[2] = leds[5] = leds[8] = leds[11] = CRGB::Blue;
FastLED.show();
delay(500);
}
int dt=50;
byte rot = 128; byte gruen = 64; byte blau = 160;
void loop() {
for (byte nr=0; nr<NUM_LEDS; nr++) {
leds[nr].setRGB(rot, gruen, blau);
FastLED.show();
delay(dt);
rot = rot + 32;
gruen = gruen + 32;
blau=blau+16;
}
String txt = String(rot) + " " +String(gruen) + " " + String(blau);
Serial.println(txt);
}