Arduino FastLED double canal

Bonsoir,

Je suis un peu perdu dans mon code, je sais ce que je veux mais j'ai du mal a le coder.

Voila j'ai deux rubans WS2812 sur le même canal. J'aimerais ajouter encore 2 pixels mais le soucis c'est que les données une fois passé par le canal 1 si je branche mes 2 pixels supplémentaire, j'ai des soucis au niveau des couleurs, mauvaise couleurs, clignotement..

Channel 1 (pin 2) mes deux rubans
Channel 2 (pin 6) mes deux pixels

Je pourrais utiliser transmettre via un Bus différentiel mais j'aimerais le faire via software
Le tout doit fonctionner avec hyperion sur RPI (le reste du code)

Voici mon début de code:

#include "FastLED.h"

// How many leds in your strip?
#define NUM_LEDS_ALL 6

#define NUM_LEDS_CH1 4
#define CH1_DATA_PIN 2

#define NUM_LEDS_CH2 2
#define CH2_DATA_PIN 6

// For led chips like Neopixels, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN

#define CLOCK_PIN 13

#define COLOR_ORDER GRB

// Adalight sends a "Magic Word" (defined in /etc/boblight.conf) before sending the pixel data
uint8_t prefix[] = {'A', 'd', 'a'}, hi, lo, chk, i;

// Baudrate, higher rate allows faster refresh rate and more LEDs (defined in /etc/boblight.conf)
#define serialRate 460800

// Define the array of leds
CRGB channelOne[NUM_LEDS_CH1];
CRGB channelTwo[NUM_LEDS_CH2];

void setup() {
FastLED.addLeds<WS2812B, CH1_DATA_PIN, GRB>(channelOne, NUM_LEDS_CH1);
FastLED.addLeds<WS2812B, CH2_DATA_PIN, GRB>(channelTwo, NUM_LEDS_CH2);

// initial RGB flash
LEDS.showColor(CRGB(255, 0, 0));
delay(5000);
LEDS.showColor(CRGB(0, 255, 0));
delay(5000);
LEDS.showColor(CRGB(0, 0, 255));
delay(5000);
LEDS.showColor(CRGB(0, 0, 0));

Serial.begin(serialRate);
Serial.print("Ada\n"); // Send "Magic Word" string to host

}

void loop() {
/*
// wait for first byte of Magic Word
for(i = 0; i < sizeof prefix; ++i) {
waitLoop: while (!Serial.available()) ;;
// Check next byte in Magic Word
if(prefix == Serial.read()) continue;

  • // otherwise, start over*

  • i = 0;*

  • goto waitLoop;*

  • }*

  • // Hi, Lo, Checksum*

  • while (!Serial.available()) ;;*

  • hi=Serial.read();*

  • while (!Serial.available()) ;;*

  • lo=Serial.read();*

  • while (!Serial.available()) ;;*

  • chk=Serial.read();*

  • // if checksum does not match go back to wait*

  • if (chk != (hi ^ lo ^ 0x55))*

  • {*

  • i=0;*

  • goto waitLoop;*

  • }*

memset(leds, 0, NUM_LEDS_ALL * sizeof(struct CRGB));

  • // read the transmission data and set LED values*
  • for (uint8_t i = 0; i < NUM_LEDS_ALL; i++) {*
  • byte r, g, b; *
  • while(!Serial.available());*
  • r = Serial.read();*
  • while(!Serial.available());*
  • g = Serial.read();*
  • while(!Serial.available());*
  • b = Serial.read();*
    _ leds*.r = r;_
    _ leds.g = g;
    leds.b = b;
    }
    /
    // shows new values

    FastLED.show();
    }
    Merci a vous_

de mémoire - Il me semble que l'on appelle

FastLED.addLeds<TYPE, DATA_PIN, CLOCK_PIN>(leds, NUM_LEDS);

Ou

FastLED.addLeds<TYPE, DATA_PIN, CLOCK_PIN, RGB, DATA_RATE_MHZ(xx)>(leds, NUM_LEDS);

Pas sûr que FastLED.addLeds<WS2812B, CH1_DATA_PIN, GRB>(channelOne, NUM_LEDS_CH1); ne soit pas confondu avec la première forme et il manque la clock?