#include "FastLED.h"
// Matrix size
#define NUM_ROWS 10
#define NUM_COLS 10
// LEDs pin
#define DATA_PIN 3
// LED brightness
#define BRIGHTNESS 180
#define NUM_LEDS NUM_ROWS * NUM_COLS
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
DrawRow();
FastLED.clear();
}
void DrawRow() {
int speed = 200;
int y ;
int x ;
int hw = NUM_COLS / 2;
for (y = NUM_ROWS; y >= 0; y--) {
for(x = 0; x < hw; x++) {
if(y > 0) {
leds[(y-1)*NUM_ROWS + x] = CRGB::White;
}
if(y < NUM_ROWS) {
leds[y*NUM_ROWS + x + hw] = CRGB::White;
}
FastLED.delay(speed);
FastLED.show();
}
}
}