#include <FastLED.h> //FastLed library version 3.2.1 - https://github.com/FastLED/FastLED/wiki/Overview or http://fastled.io/ with NEOPIXEL or WS2812B
#define NUM_STRIPS 2 // number of led strips (in this example are front left and front right)
#define NUM_LEDS_PER_STRIP 20 // number of leds per each strip
CRGB leds[NUM_STRIPS][NUM_LEDS_PER_STRIP];
uint8_t gHue = 0; // rotating "base color" used by many of the patterns
void setup() {
FastLED.addLeds<NEOPIXEL, 9>(leds[0], NUM_LEDS_PER_STRIP); //led strip for front right
FastLED.addLeds<NEOPIXEL, 10>(leds[1], NUM_LEDS_PER_STRIP); //led strip for front right
//FastLED.clear();
//FastLED.show();
}
void loop() {
// Slower:
// Strobe(0xff, 0x77, 0x00, 10, 100, 1000);
// Fast:
Strobe();
}
void Strobe(){
Strobe(0xFF, 0x00, 0x00, 5, 10, 20);
Strobe2(0x05, 0x16, 0xFF, 5, 10, 20);
//Strobe3(0xff, 0xff, 0xff, 2, 10, 160);
}
void Strobe(byte red, byte green, byte blue, int StrobeCount, int FlashDelay, int EndPause){
for(int j = 0; j < StrobeCount; j++) {
setAll(red,green,blue);
showStrip();
delay(FlashDelay);
setAll(0,0,0);
showStrip();
delay(FlashDelay);
}
delay(EndPause);
}
void Strobe2(byte red, byte green, byte blue, int StrobeCount, int FlashDelay, int EndPause){
for(int j = 0; j < StrobeCount; j++) {
setAll2(red,green,blue);
showStrip();
delay(FlashDelay);
setAll2(0,0,0);
showStrip();
delay(FlashDelay);
}
delay(EndPause);
}
void Strobe3(byte red, byte green, byte blue, int StrobeCount, int FlashDelay, int EndPause){
for(int j = 0; j < StrobeCount; j++) {
setAll3(red,green,blue);
showStrip();
delay(FlashDelay);
setAll3(0,0,0);
showStrip();
delay(FlashDelay);
}
delay(EndPause);
}
void showStrip() {
FastLED.show();
}
void setPixel(int Pixel, byte red, byte green, byte blue) {
leds[0][Pixel].r = red;
leds[0][Pixel].g = green;
leds[0][Pixel].b = blue;
}
void setPixel2(int Pixel, byte red, byte green, byte blue) {
leds[1][Pixel].r = red;
leds[1][Pixel].g = green;
leds[1][Pixel].b = blue;
}
void setPixel3(int Pixel, byte red, byte green, byte blue) {
leds[1][Pixel].r = red;
leds[1][Pixel].g = green;
leds[1][Pixel].b = blue;
leds[0][Pixel].r = red;
leds[0][Pixel].g = green;
leds[0][Pixel].b = blue;
}
void setAll3(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++ ) {
setPixel3(i, red, green, blue);
}
showStrip();
}
void setAll2(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++ ) {
setPixel2(i, red, green, blue);
}
showStrip();
}
void setAll(byte red, byte green, byte blue) {
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++ ) {
setPixel(i, red, green, blue);
}
showStrip();
}