If you use the FastLED library, it can't get much easier than FastLED's Blink example and FastLED's FirstLight example if you want to understand out how it works
- Create a FastLED variable (object).
- In
setup()
, specify which LED type you're using and the pin. - In
loop()
, apply the pattern that you want.
Play around using different colours and find out that colours might be swapped; e.g. when setting a LED to red it turns green and vice versa. If so, adjust the line in setup()
to reflect the correct order.
It's often referred to as sweep.
The FirstLight example will show you a light that goes from one side to the other pixel by pixel.
To understand how you can go back from the 'other' side to the 'one' side, you can [u]study[u] e.g. the IDE's servo sweep example (not part of FastLED). You can also search the web for 'Knightrider' examples which provides similar functionality (moving left to right to left).
If you have split your strip in N segments of 7 LEDs and want to change the 7 LEDs of a segment at the same time (it's not 100% clear to me if that is the case), you can change 7 LEDs at the same time using e.g. a double for-loop.
Study the 01.Basics → AnalogReadSerial example to understand how to read the potentiometers. Next think how you can apply it to your sweep functionality and implement it.
I suggest that you start coding; if you get stuck, show your code (don't forget to use so-called code tags as described in How to get the best out of this forum), explain what that code should do and what it actually does. We will try to help you with the problem.