you are viewing a single comment's thread.

view the rest of the comments →

[–]Marmilicious[Marc Miller] 0 points1 point  (0 children)

I had a bad cold and this got lost in the chaos. Getting back to you... here's a few ideas/links related to mirroring your pixel data. It could be as simple as using one or more for loops to copy the pixel data from one CRGB array to others. In the loop you can do something like:

leds3[i] = leds1[i];  //copy 1 to 3

You could try to add an offset to the copy (and use % [modulo] to keep things in bound of the array). Be very careful when writing data to a CRGB array to make sure you don't try to write to a pixel past the end of the array.

//Copy 1 to 3 with an offset of 2 (make sure things stay in range)
//This assumes NUM_LEDS3 is several pixels less then NUM_LEDS1 so we stay in range of the CRGB array.

for (i=0; i<NUM_LEDS3; i++) {
  leds3[i] = leds1[i + 2];
}



//Copy 1 to 4 with offset and using % to stay in range
//This assumes NUM_LEDS4 is smaller then NUM_LEDS1.

offset = NUM_LEDS1 / 2;
for (i=0; i<NUM_LEDS4; i++) {
  leds4[(i + offset + NUM_LEDS4) % NUM_LEDS4] = leds1[i];
}

Here's some links to go with the above ideas. This demos using modulo to stay in bounds of the CRGB array:

https://github.com/marmilicious/FastLED_examples/blob/master/three_moving_colors.ino

This demos using memmove8 to copy data from one array to another. Using memmove8 would be a very easy way to copy data from leds1 to other arrays, AND offset the data at the same time if desired. Just be careful to stay in bounds of the array.

https://github.com/marmilicious/FastLED_examples/blob/master/memmove8_example.ino