// MultiArrays - see https://github.com/FastLED/FastLED/wiki/Multiple-Controller-Examples for more info on
// using multiple controllers. In this example, we're going to set up four NEOPIXEL strips on three
// different pins, each strip getting its own CRGB array to be played with
#include "FastLED.h"
#define NUM_LEDS_PER_STRIP 11
CRGB redLeds[NUM_LEDS_PER_STRIP];
CRGB blueLeds[NUM_LEDS_PER_STRIP];
unsigned long previousMillis = 0;
const long Speed = 500;
const long WaitB = 1000;
// For mirroring strips, all the "special" stuff happens just in setup. We
// just addLeds multiple times, once for each strip
void setup() {
// tell FastLED there's 60 NEOPIXEL leds on pin 10
FastLED.addLeds<NEOPIXEL, 12>(redLeds, NUM_LEDS_PER_STRIP);
// tell FastLED there's 60 NEOPIXEL leds on pin 12
FastLED.addLeds<NEOPIXEL, 13>(blueLeds, NUM_LEDS_PER_STRIP);
}
void loop() {
unsigned long currentMillis = millis();
for(int i = 0; i < NUM_LEDS_PER_STRIP; i++) {
// set our current dot to red, green, and blue
redLeds[i] = CRGB::Red;
redLeds[i+1] = CRGB::Red;
blueLeds[i-1] = CRGB::Blue;
blueLeds[i-2] = CRGB::Blue;
FastLED.show();
// clear our current dot before we move on
redLeds[i] = CRGB::Black;
redLeds[i+1] = CRGB::Black;
blueLeds[i-1] = CRGB::Black;
blueLeds[i-2] = CRGB::Black;
delay(100);
}
for(int i = NUM_LEDS_PER_STRIP-1; i >= 0; i--) {
// set our current dot to red, green, and blue
redLeds[i] = CRGB::Black;
redLeds[i+1] = CRGB::Black;
blueLeds[i-1] = CRGB::Black;
blueLeds[i-2] = CRGB::Black;
FastLED.show();
redLeds[i] = CRGB::Black;
redLeds[i+1] = CRGB::Black;
blueLeds[i-1] = CRGB::Black;
blueLeds[i-2] = CRGB::Black;
delay(60);
}
}
In this code there are 2 delays and I want to get rid of them because I'm going to implement the code into another code. I have tried to do it but without succes. I get what to do with millis() in the blinkwithoutdelay sketch but I don't get it to work with this code.