you could start with something like this, simplifying your example sketch.
Notice how I put the EL wires into an array... this simplifies the programming and you can treat the pins as if they were numbered zero through seven (0-7) which makes it programmer friendly. The first element in an array is zero not one.
I added two examples of the BlinkWithoutDelay to your sketch. One in the loop() function where you will notice that the sketch now alternates between two flashing functions, marquee() and knightRider().
then, you will see in each of those functions (marquee() is your code modified for the BlinkWithoutDelay method) that the wires light up in order, and are controlled by the amount of time (100milliseconds) each led is lit.
Now, you can add to your sketch the bit about reading the binary switch and choosing which function to run depending on the values you retrieve. You get to do this all without any blocking code or delays.
int wire [8] = {2,3,4,5,6,7,8,9}; // I created an array for your wires... the EL channels are on pins 2 through 9
unsigned long cycleStart, startTime;
//
void setup()
{
Serial.begin(115200);
for (int i = 0; i < 8; i++)
{
pinMode(wire[i], OUTPUT);// notice how I initialized the pins with fewer lines of code
}
pinMode(10, OUTPUT);
pinMode(13, OUTPUT);
}
void loop()
{
// see note below....................
if (millis() - startTime >10000UL)
{
knightRider();
}
else if (millis() - startTime >20000UL)
{
marquee();
}
else startTime = millis();
// replace this stuff above here with your code to sense the switch and run your functons.
// like th Jiggy-Ninja example...
}
//
void marquee()
{
static int index;
if (millis() - cycleStart >= 100UL)
{
digitalWrite(wire[index], LOW);
Serial.println(index);
index++;
if (index > 7) index = 0;
digitalWrite(wire[index], HIGH);
digitalWrite(13, !digitalRead(13));
digitalWrite(10, !digitalRead(13));//alternating flashing, remove the "!" to flash together
cycleStart += 100UL;
}
}
//
void knightRider()
{
static int index;// not a good practice to use the same variable name here as the other function so shame on me!
static int myDir = 1;// controls the direction of the 'motion'
if (millis() - cycleStart >= 100UL)
{
digitalWrite(wire[index], LOW);
index += myDir;
digitalWrite(wire[index], HIGH);
digitalWrite(13, !digitalRead(13));
digitalWrite(10, !digitalRead(13));//alternating flashing, remove the "!" to flash together
cycleStart += 100UL;
if (index > 6 || index < 1) myDir = -myDir;
}
}