#include <FastLED.h>
#define WIDTH 16
#define HEIGHT 16
#define NUM_LEDS ((WIDTH) * (HEIGHT))
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<NEOPIXEL, 6>(leds, NUM_LEDS);
}
void loop() {
fill_solid( leds, NUM_LEDS, CRGB::Red);
FastLED.delay(200);
fill_solid( leds, NUM_LEDS, CRGB::Black);
FastLED.delay(200);
fill_solid( leds, NUM_LEDS, CRGB::Blue);
FastLED.delay(200);
fill_solid( leds, NUM_LEDS, CRGB::Black);
FastLED.delay(200);
cd77_colorwipe_dot(CRGB::Red, 0, NUM_LEDS, 5);
cd77_colorwipe_dot(CRGB::Blue, 0, NUM_LEDS, 5);
cd77_colorwipe_dot(CRGB::Green, 0, NUM_LEDS, 5);
}
//==================== Functions ===============================
void cd77_colorwipe(CRGB color, uint16_t to, uint16_t wait) {
for (uint16_t i = 0; i <to; i++) {
leds[i] = color;
FastLED.delay(500);
}
}
void cd77_colorwipe_dot(CRGB color,uint16_t from, uint16_t to, uint16_t wait) {
for (uint16_t i = from; i <to; i++) {
leds[i] = color;
FastLED.delay(wait);
leds[i] = CRGB::Black;
FastLED.show();
}
}