An array playlist?

So I’m working on controlling a series of solenoids through a shift register or 2 or 3… The final result will be a fountain display. I’ve read through the tutorial of how to use an array to go through line by line to a shift register. I think I get it. I’ve also read some posts about loading a “array.txt” from an SD card and parsing through that. What I want to be able to do is load an SD card with several routines: 1.txt, 2.txt, etc. Sometimes there may be 1 in the playlist, sometimes there may be 3 or more routines.

If there was always 3 items in the playlist, I could just load 1.txt, play it, then move on through a series of while(n=0, n<<3, n++) loops. If I wanted 10 items today, 1-3 would play and then loop back around skipping 4-10.

I think the solution is to have it load an array “playlist.txt” containing the names of the file names. Then have nested while loops.

I’m not asking for a handout on the code. That’s part of the fun. But is my logic moving in the right direction?

sounds like you are in the right direction (imho)

Perhaps what you should have is a file on the SD card called playlist.txt that contains the names of the files to "play".

Yes, that's one way.

Another is to use SD card methods that allow you to list the files in a directory.