# I need help with a project.

(Jon-Paul Taylor) #1

I need help with a project. I’m trying to build 4 columns for a wedding with 8 led strips each. I’m want to produce a fairy/leaf falling effect that zigzag zag down across 8 strips with white and a second color.uh I can manipulate code…but not so good from scratch. Any starting point would be good.

(Jason Coon) #2

I would map the strips as an XY grid, like this: https://github.com/FastLED/FastLED/blob/master/examples/XYMatrix/XYMatrix.ino

Then just keep an XY position for each fairy/leaf. Make a class/struct for them and add them to an array if you want a lot of them. Then just move them down and back and forth at whatever speed, something like this:

EVERY_N_MILLISECONDS(30) {
fairy.y–;
fairy.x += random(0, 3) - 1;
}

And draw them with:

leds[XY(fairy.x, fairy.y)] = CHSV(pixelHue, 255, 255);

(Jon-Paul Taylor) #3

Ive seen this example with FasLed. I understand the setup, but not sure how to control the DrawOneFrame

(Jason Coon) #4

I can’t test this at the moment, but I threw together a quick example. Hopefully it’ll help you get started: https://gist.github.com/jasoncoon/ac9f3a4a3e0c2f02bfed

(Jon-Paul Taylor) #5

wow. so far this is very cool. definitely a great start to this project. What does the first number represent on hue:

fairies[i].hue = (0, 128);

(Jon-Paul Taylor) #6

i assumed it was saturation, but it doesn’t seem to do anything

(Jason Coon) #7

I think that line should be: fairies[i].hue = random(0, 256); It just picks a random number between 0 and 255, and uses it as the hue: https://github.com/FastLED/FastLED/wiki/Pixel-reference#introduction-to-hsv

(Jon-Paul Taylor) #8

yeah i removed random to set a certain color which works…just curious about that first value.

(Jason Coon) #9

Then the line should just set hue to a single number: fairies[i].hue = 0;

(Jon-Paul Taylor) #10

LOL yeah thats what i just tried. this works great BTW…thanks a lot.

(Jon-Paul Taylor) #11

oh duh i see. if it was random it would be between 0 and 256…got it

(Jon-Paul Taylor) #12

ok so i went back set random within a blue range…nice

fairies[i].hue = random(107, 167);

(Myche Tician) #13

How are the strips wired for that install? vertically and then the top end of one is wired to the bottom end of the next one over?

(Jon-Paul Taylor) #14

@Myche_Tician yup…so far