I'm using the Fast.LED library to control a string of 50 LEDS. My very simple test code is shown below. I expected the LEDs to all go off and be off for 1.5 seconds due to the delay command after the FastLED.clear command. However, the LEDs remain lit for the 1.5 second delay, then go off and the fill loop starts again immediately. I've tried putting in two clear commands followed by delay commands. Then the LEDs still remain lit until the end of the combined delays and the fill sequence starts immediately. It behaves as if the delay command is before the clear command instead of after.
#include "FastLED.h"
#define NUM_LEDS 50 //How many leds in your strip?
#define DATA_PIN 5 //Arduino board pin used for led strip data
CRGB leds[NUM_LEDS]; // Define the array of leds
void setup() {
LEDS.addLeds<WS2811,DATA_PIN,RGB>(leds,NUM_LEDS); //Set up the LED string
}
void loop() { //This is the main program loop
CRGB color = CRGB::Red;
LEDS.setBrightness (50);
for( int i = 0; i < NUM_LEDS; i++) {
leds[i] = color;
delay(60);
FastLED.show();
}
FastLED.clear(); //Turn off all LEDs
delay (1500);
} //====================== END void loop =================================