Can you Crossfade Palettes while Writing to Multiple Controllers for FastLED?


I'm newer to Arduino and c but here's where I've gotten with my current sketch.

I'm using the MPR121 and FastLED libraries. I am trying to use capacitive sensing to trigger different LED Palettes on different strips depending on which touchpad you touch. For example, touch Touchpad 1, LED strip fades between colors. Touch Touchpad 2, LED strip 2 fades colors, etc. Please note, in this sketch I've set it to two strips with 50 LED's each but I will be (hopefully) talking to more, if I sort out this bug. My strips will be 150 in length, and if possible I'm trying to reach 4 strips.

In terms of references I've used, for multiple LED's strips I've looked at the "Managing Your Own Output" method to save on SRAM. (Multiple Controller Examples · FastLED/FastLED Wiki · GitHub). I tried the other approaches with auto management (i.e.,; ) and I find the memory usage is around (~89%) VS (~51%) with manual management.

With regards to the fading of the LED's I am using the Mark Kriegsman sketch on crossfading between palettes with FastLED (How to cross-fade between color palettes using nblendPaletteTowardPalette · GitHub)

I can get different sensors triggering different palettes on different LED strips when I'm using the simple palette approach where you set the current palette (similar to this: FastLED/ColorPalette.ino at master · FastLED/FastLED · GitHub). I have added comments in my code to show that this works. What I desire however is to crossfade between colors when a touchpad is touched.

I cannot however seem to get the crossfading LED code to work. In my attached sketch, you would do this by assigning the CRGBPalette16 variable "targetPalette" a color as Kriegsman outlines. When I set the palette using this variable, both strips change at once, whereas I want them to change independently. I believe this has something to do with the nblendPaletteTowardPalette() function in the FastLED library, but I do not know why it is writing to both LED strips. Any ideas as to what could be causing this? Example code is also appreciated as again, my c-fu isn't the strongest.

For easy reference, my LED functions are generally called in my updateLED() function.

If stuff is unclear or anything needs to be clarified, please let me know.

Thank you in advance!

Fast_LED_Manual_Memory_Target_Palette.ino (4.98 KB)