Code sample to make animation wide. Sorry for pore English.

(варешяф рйезот) #1

Code sample to make animation wide.
Sorry for pore English. And I’m not good programmer, but I want to share my code, may be it would be useful for somebody

I need to make tree leaf with FastLED animation. Leaf is wide, and to light all surface I need to put led strips parallel one each other.
Animation would be from bottom to top, in one direction (not from left to right).
I make procedures, that helps to easy setup different configurations.
I make pictures, that helps you to understand what I mean.
It would be nice, if my code helps for somebody. You can use it as you want.

In comments you can see other pictures, that may be helpfull to understand.

(варешяф рйезот) #2

Here prototype of leaf.

missing/deleted image from Google+

(варешяф рйезот) #3

Look here and I hope you can easy understand what code do ))

Take attention to number ordering of each strip. Reversed strips you need to setup in right down corner code example.
missing/deleted image from Google+

(варешяф рйезот) #4

there are error in LOOP. We need to add call for animation procedure:
void loop() {

(варешяф рйезот) #5

I make some changes for better code setup, reading and understand.

For example you want to make same project, but not with 5 strips total, but 7.
Okay, open code and I will say what you need to change ) Make changes in another window, because I will write rows number as they are in this code.

First of all you need to setup your leds.
Change parameters in 7-9 rows for your leds. In 10 row don’t use number larger 230 (better to set less). It will bring more life to your leds, but your eyes wouldn’t see large difference with 255 value.
Then, set TOTAL_STRIPS in row 12 to “7” and change leds quantity for STRIP0. This strip is main and all animations needs to be calculated for it.

Next you need to set leds parameters in rows 26-30 as you need. Also, add there 4 rows to write coordinates for additional 2 strips (2 rows for each mirrored from center).

Now, you need to add your animation procedures, add calls to them in loop function or add other algorithm to call them (time, button, or any what you need).
Just change in existing animations, that you want to add to this code (for-cycles for example) NUM_LEDS to NUM_LEDS_STRIP0
And don’t forget to call strip copying procedure in animations, that you will paste here. Just add copyStrips(); after led array filling operator.

That’s all! I think it is very simple )

P.S. Code compiling, but I do not sure, that there no principle mistakes. If some body hi-skill programmer find them - please note it to all.
And I will be glad, if somebody native-speaking, rewrite this my terrible “manual” in his blog as this text need to be )
Thanks! Sorry for pore English.

(Chris Parton) #6

This looks really nice, and I can see you’ve put a lot of effort into the design and documentation. Great work!

(Jo Miller) #7

great job thanks