Need help illuminating an art installation

Hello,

Need help with code for an art installation!

I need to light up an art installation consisting of 7 cubes who need to be illuminated with an led. Each box need to light up for like two seconds then two seconds break then the next box, this should run from no. 1 - 7 and then loop, except cube no. 5 should blink continually at any rate and independent from the other ones.

I have so far figured out a code for a running light like this;

id setup(){
pinMode(1, OUTPUT);
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
}

void loop(){
digitalWrite(1,HIGH);
delay(2000);
digitalWrite(1,LOW);
delay(2000);
``digitalWrite(2,HIGH);
delay(2000);
digitalWrite(2,LOW);
delay(2000);
digitalWrite(3,HIGH);
delay(2000);
digitalWrite(3,LOW);
delay(2000);
digitalWrite(4,HIGH);
delay(2000);
digitalWrite(4,LOW);
delay(2000);
digitalWrite(5, HIGH);
delay(2000);
digitalWrite(5, LOW);
delay(2000);
digitalWrite(6, HIGH);
delay(2000);
digitalWrite(6, LOW);
delay(2000);
}

My question is how to add the flashing light to this code?

I don't really have experience with that stuff but figured out that the arduino uno can be a useful tool for it, i saw somewhere in the net a almost similar solution running light + flashing light but cant find it anymore, would really appreciate your help guys!

look into learning about arrays as well.

you can try like this (untested) code:

const byte numLeds = 6;
const byte ledPin[numLeds] = {1, 2, 3, 4, 6, 7};
const byte independantPin = 5;

void setup()
{
  for (byte i = 0; i < numLeds; i++)
  {
    pinMode(ledPin[i], OUTPUT);
  }
  pinMode(5, OUTPUT);
}

void loop()
{
  flashSequence();
  flashIndependant();
}

void flashSequence()
{
  static byte index = 0;
  static unsigned long lastMillis = 0;
  if (millis() - lastMillis < 2000UL)
  {
    if (!digitalRead(ledPin[index]))
    {
      for (byte i = 0; i < numLeds; i++)
      {
        digitalWrite(ledPin[i], index = i ? HIGH : LOW);
      }
    }
  }
  else if (millis() - lastMillis < 4000UL)
  {
    if (digitalRead(ledPin[index]))
  {
    for (byte i = 0; i < numLeds; i++)
      {
        digitalWrite(ledPin[i], LOW);
      }
    }
  }
  else
  {
    index++;
    if (index >= numLeds)
    {
      index = 0;
    }
    lastMillis = millis();
  }
}

void flashIndependant()
{
  static unsigned long lastMillis = 0;
  if (millis() - lastMillis > 1000UL)
  {
    digitalWrite(independantPin, !digitalRead(independantPin));
    lastMillis = millis();
  }
}