Can anyone advise a way to reverse the direction of the leds?

gplus
(Geo Meadows) #1

Can anyone advise a way to reverse the direction of the leds? They always seem to ‘travel’ towards the bottom end.

(Marc Miller) #2

How you do it might depend a bit on the code. Please put your code on http://gist.github.com and share the link.

Here’s two examples of patterns that can be reversed.

(Andrew Tuline) #3

Here’s a routine that has a direction change variable:

That being said, different animations may require this to be done differently. For example, if I were doing sine waves down the strand, then this wouldn’t work at all.

(Marc Miller) #4

It also might be something as simple as this:

change
leds[i] = …
to
leds[ (NUM_LEDS-1) - i ] = …

(Mike Katchmar) #5

The easy way to physically flip you LED strip :slight_smile:

If you are using For Loops, then you could initialize with the max array value and count down, instead of counting up? Or change arrange indexes to do something like leds[NUM_LEDS-i] = …

(Andreas Hopf) #6

See http://jwhendy.blogspot.com/2015/10/fastled-series-getting-started.html for a good beginner’s description how to reverse the direction.