Hi, recently I've been playing around with ESP8266, two LED strips, FastLED library and I came across a problem. Well, I wanted to create a project in which two different LED strips connected to different outputs would light two different light modes. Unfortunately, the two modes started to overlap. So I used the clearLedData() function. The modes stopped overlapping however they look different than they should. It looks like adding a black fill, to a working mode. Someone may know how to deal with this problem? I attach my code below.
#include <FastLED.h>
#define NUM_LEDS 60
#define DATA_PIN1 4
#define DATA_PIN2 2
CRGB leds[NUM_LEDS];
uint8_t h = 0;
#define NUM_STRIPS 2
CLEDController *controllers[NUM_STRIPS];
void setup() {
controllers[0] = &FastLED.addLeds<WS2812B, DATA_PIN1, GRB>(leds, NUM_LEDS);
controllers[1] = &FastLED.addLeds<WS2812B, DATA_PIN2, GRB>(leds, NUM_LEDS);
}
void loop() {
uint8_t p = map(beat8(40,0), 0, 255, 0, NUM_LEDS - 1);
leds[p] = CHSV(h, 200, 255);
fadeToBlackBy(leds, NUM_LEDS, 3);
EVERY_N_MILLISECONDS(1)
{
h ++;
}
controllers[0]->showLeds();
controllers[0]->clearLedData ();
uint8_t A2 = beatsin8(25, 0, NUM_LEDS +1, 0, 0);
uint8_t B2 = beatsin8(50, 0, NUM_LEDS +1, 0, 0);
uint8_t C2 = beatsin8(20, 0, 255, 0, 0);
leds[(A2+B2)/2] = CHSV(C2, 255, 255);
fadeToBlackBy(leds, NUM_LEDS, 10);
controllers[1]->showLeds();
controllers[1]->clearLedData();
}