Profile

Tony Youngblood
217 followers|250,831 views

Stream

Tony Youngblood

Support  -

Ok, so I've figured out how to cycle a band of lights over this arch ( https://youtu.be/SeIPkWAIdEE ) and get them to change color. But I'm pulling my hair out on how to get them to create a short tail.

Code here: http://pastebin.com/hjtHPvAY

In the pastebin link, the code that's producing the fade in the video is excised, but it was "fadeToBlackBy( leds, NUM_LEDS, 128);" right after FastLED.show(); delay(75);

What I'm trying to get is a fading tail of 2 rows after the main row.

Several things confuse me.

First, I thought fadeToBlackBy( leds, NUM_LEDS, 128) subtracted 128 from 256 (assuming a starting brightness of 256) and then on the next pass, it subtracted 128 from 128. and then at 0 it just stayed black. But now I see that it is actually is a percentage. So in the case of 128, each call of fadeToBlack reduces the brightness by 50 percent. But if that's the case, it is like Zeno's runner paradox. It'll keep getting closer to 0 but never actually getting there:

256 x .5 = 128
128 x .5 = 64
64 x .5 = 32
...
2 x .5 = 1
1 x .5 = .5
5. x .5 = .25
.25 x .5 = .125
.125 x .5 = .0625
...

And so on. Yes, in terms of getting the LED to effectively look black, it will get there, but with many more passes than a simple subtraction.

So that's the first thing I don't completely understand. (And I've read through everything I could find on FadeToBlackBy here and elsewhere.)

Next problem:

Ok, so I know that by calling fadeToBlackBy( leds, NUM_LEDS, 128); within a loop that iterates LED by LED (or in my case by a range of LEDs), I am placing a command that calls ALL the LEDs within a loop that is speaking to a range at a time. And that's not good.

So instead, I might want to use the expression like this: leds[i].fadeToBlackBy(128);

But the problem I now face is how to get it to refer to the previous iteration of "i." I could do, for example, i-1, (or in my case, in a command that somehow merges fill_gradient with fadeToBlackBy, i+31 (because I'm going backwards and each band of lights is 31 long)), but that would mess up when it gets to the end.

Any way I try it, I end up either leaving the trail on at a set level (for example, 50 percent less bright than the lead band), or getting a trail that spans all 7 trailing rows that never totally fades out.

So, to make a long story short, I'm stumped. Any ideas?

Also, thank you for this wonderful community!﻿
1
1

I have some patterns that does that type of motion and never noticed that feeling occuring, but certainly seems feasible.  That Art Pod project is pretty cool.  Wish I lived closer as it would not take much to make something like that with my existing projects. ﻿

Tony Youngblood

Shared publicly  -
1

Tony Youngblood

commented on a video on YouTube.
Shared publicly  -

What studio?﻿

Tony Youngblood

Shared publicly  -
1

Tony Youngblood

Shared publicly  -
1

Tony Youngblood

Shared publicly  -
1
In his circles
235 people
Have him in circles
217 people

Tony Youngblood

Support  -

Hello everyone,

I'm still learning FastLED and C++, and I have a question about some code.

I have a grid that's basically 31 LEDs wide by 8 rows. I want to light the last row, then move to the next row, then move to the next, and so on.
But I also want the hue to change by 16 for every cycle of the 8 rows.

So I figured I could make a nested loop as such:

void loop() {
for(int h = 0; h < 241; h += 16) {
for(int i = NUM_LEDS; i >= 0; i -= 31) {
fill_solid(leds, NUM_LEDS, CHSV(0,0,0));
delay(75);
FastLED.show();
}
}
}

The cycling works fine, but the hue keeps a value of 0 (red) throughout. What am I doing wrong?

Thank you!
Tony﻿
1

Thank you, . Done.﻿

Tony Youngblood

Shared publicly  -
1

Tony Youngblood

Shared publicly  -
1

The slides look dangerous!!   Wow,almost 200,000 views! ﻿

Tony Youngblood

Shared publicly  -
1

Tony Youngblood

Shared publicly  -
1

Tony Youngblood

Shared publicly  -
1
People
In his circles
235 people
Have him in circles
217 people
Other profiles
Basic Information
Gender
Male