void loop()
{
int position = 0;
bool keep_going=true;
while (keep_going)
{
if (position == 209)
keep_going = false;
fadeToBlackBy(leds, NUM_LEDS, 100); // Dim what's been done before
leds[position] = CHSV(0,255,255); // Activate latest position
FastLED.show();
position++;
}
@Jason_Coon Well that certainly explains that. I’m going to hunt down the actual timing fastled does and see if I can code something that calculates how to jump more or less depending on how fast I want it to go. Thank you.
Coding your animations around millis() and micros() is useful to control the timing. For example, you could check how much time has passed since the last loop and increment your dot position accordingly.
Yeah, or use any of the wave generator functions in FastLED, or beat8 which sweeps from 0 to 255 at an interval you specify (0 to 255 beats per minute). At high rates it will skip numbers, but you can keep track of the previous position and fill to the new position, like this: https://gist.github.com/kriegsman/261beecba85519f4f934
Can someone explain the timebase and phase_offset arguments in the beat functions? I’m trying to find a way to reset the beatsin16 function so that after I run the cylon once, I can run it again and still start at zero the second time (and every other time after). I’m guessing the other arguments might have something to do with it but experimentation hasn’t gotten me anywhere. A search in the documentation for timebase came up with zero. If there’s a way to use the documentation to find it next time, I’d love to learn how.