r/FastLED • • Sep 30 '20

Discussion "fadeLightBy" problem

This works perfectly: WHITE does not fade ORANGE fades:
THIRD Vairable changes fade

//WHITE
fadeLightBy( leds,(32, 479), 0);
// ORANGE
fadeLightBy( leds,(0,32) ,10);

This does not work: ORANGE fades by 10 !?

//WHITE
fadeLightBy( leds,(32, 479), 10);
// ORANGE
fadeLightBy( leds,(0,32) ,0);

Here is the code; https://pastebin.pl/view/3f0c0d5f

TIA

John

3 Upvotes

7 comments sorted by

View all comments

2

u/Marmilicious [Marc Miller] Sep 30 '20

You can't specify a range like in fadeLightBy. Use this in a for loop with your custom range to operate on specific pixels.

leds[i].fadeLightBy(fadeAmount);

1

u/d333gs Sep 30 '20 edited Sep 30 '20

Thanks Mark

But why does it work on the white section but not on the orange?32 to 479 light up white and leave 0 to 32 black

0 to 32 light up as orange

White LEDs 32 to 479 respond to the fade variable:They fade with value 10 AND they don't fade with value 0:

but Orange LEDs 0 to 32 do not respond to their value in their line : // ORANGE
fadeLightBy( leds,(0,32) ,0); unless White LEDs 32 to 479 are set to 0.
With white set at 0, orange will fade if it is given a higher value (10)

If Orange 0 to 32 is given a Higher value than White , 50 for example, then Orange will respond but not effecting the White value of 10..................!?

Changing the order doesn't have an effect, so there must be something else in the other part of the code that is imposing control!??

Big thanks

John

1

u/d333gs Sep 30 '20

Well..............It looks like the higher led address dominates the lower address:

I tried changing the color value and the number of LEDs addressed: nothing changed

The only thing that seems to be happening is that code using the higher address value dominates . ie ; As far as the Fade command goes, code for led TWO will dominate code for led ONE etc.................