Hey, I am using a Teensy 3.2 and Adafruit's Dotstar (APA102).

Hey, I am using a Teensy 3.2 and Adafruit’s Dotstar (APA102). I have separate sections of my LED strip that will each need a different brightness. Along with that, when I modify the color and brightness of one section and then modify another, I do not want the first section’s color nor brightness to change. I am able to get the colors to change independently, but not the brightness. I tried to use fadeToBlackBy in the same loop as when I’d set the colors (via CRGB), but it would modify all of the LEDs on the strip not just the section itself.

My loop looks like this:
for (int j = SectionLEDs[i]; j < SectionLEDs[i + 1]; j++)
{
leds[j] = CRGB(colorArray[2], colorArray[1], colorArray[0]);
leds[j].fadeToBlackBy(brightness);
}
FastLED.show();

Is there something that I am missing or a better way of modifying brightness on only a certain amount of LEDs?

Thank you,
David

There was another question on this. See here:
https://plus.google.com/106744445644331409502/posts/PGMZ4n6W3SY

Another good option is to use HSV instead of RGB. Then you can specify the V for each section exactly as needed.

If the sections are on different pins and you’re using separate addLeds lines you can also cheat it with a color correct.

Hi marc,

Thanks for the reply! I actually used that post as my original reference. I just am having no luck with the fadeToBlackBy function and am unsure if I am missing something when writing to one section and another right after.
I am aware of the HSV function, but am trying to avoid rewriting much of my code’s functions.
The sections are not on different pins, but thanks for the idea.

@David_Volovskiy Post your code on http://gist.github.com and share the link if you’d like someone to have a look.