#define LED_NUM 48
#define LED_PIN 7
#include <FastLED.h>
CRGB leds[LED_NUM];
void setup() {
FastLED.addLeds< WS2812, LED_PIN, GRB>(leds, LED_NUM);
FastLED.setBrightness(255);
}
void loop() {
//FastLED.clear();
for (int j=0; j<=15; j++){
FastLED.clear();
screen(j,255,0,0);
screen(31-j,255,0,0);
screen(47-j,0,255,0);
FastLED.show();
delay(200);
}
}
void screen(int x, int r, int g, int b){
for (int i=0; i<=0; i++){
leds[i+x].setRGB(r,g,b);
}
}