Help With FastLED Demo Reel Sinelon

Hello,
(Apologies in advance if I have not posted in the correct section)

I am very new to Arduino and have started playing around with the FastLED Demo Reel for an infinity mirror project.
The code pasted below is one of the LED effects within FastLED that I am using, could somebody show me how I could change this code so that when the sweeping LED gets to the end of the strip it starts back at the beginning to give the effect of it looping round instead of bouncing from one end of the strip to the other.

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void sinelon()
{
// a colored dot sweeping back and forth, with fading trails
fadeToBlackBy( leds, NUM_LEDS, 20);
int pos = beatsin16( 13, 0, NUM_LEDS-1 );
leds[pos] += CHSV( gHue, 255, 192);
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.