I have to make a chase down a lenght of LED and have found

I have to make a chase down a lenght of LED and have found this in the demo code.
void sinelon()
{
// a white dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 30);
int pos = beatsin16(12,0,NUM_LEDS);
leds[pos] += CRGB::White;
}

Can this be made to travel in one direction only not back and forth as it currently does?
Any help apreciated

Here’s an example that might work for you.

Also, try out the “FirstLight” example that’s included with FastLED. :wink:

Thanks Marc
I will give them a try

@marmil is there a way to “freeze frame” this code? I want to be able to run it for a few seconds and then have it freeze at a random moment.

@Erin_St_Blaine Freeze permanently, or for awhile and then run again for a random time?

Here’s an experiment for you @Erin_St_Blaine
http://pastebin.com/tc4CTCCr
I’m guessing you’re either going to use this in some awesome version of musical chairs, or for a 10 foot tall digital raffle wheel. :wink:

heh. You’re close! I’m gonna tell fortunes. Thanks so much, I’ll play with this!!

@Erin_St_Blaine My beat8_plus_random_freeze.ino example does work. But I just realized I probably made it WAY more complicated then needed. (Isn’t it funny/great/trippy when you look at something again and see a much simpler solution?) In my original beat8.ino example above, if you want it to stop moving change the moveSpeed variable to… zero! lol.

It could be suddenly changed to zero or even ramp down to zero via code after a random time. Prior to stopping the moveSpeed could also be modulated with sin8, or some sort of external sensor (yeah!). I leave it to your wonderful creative side as to how to do that. :smiley: