Trying to use an aray as a set of pin values

I am trying to create a Simon memory game for one of my friends and I have started off trying to just get 4 leds to flash at the end of each round completed. I have gotten them to flash using a for statement, a delay outside of the for statement, then another for statement. (full code printed below)

this is the code

for(int leds = 10; leds <= 13; leds ++)
  {
    digitalWrite(leds, HIGH);
  }
    delay(1000);
  for(int leds = 10; leds <= 13; leds ++)
  {
    digitalWrite(leds, LOW);
  }

After achieving this I moved on to trying to complete the same action with an array. I declare the array lightPins with this line of code (full code printed below)

int lightPins[5] = {10, 11, 12, 13};

later I try to recall it using this format

digitalWrite(lightPins, HIGH);
    delay(delayTime);
    digitalWrite(lightPins, LOW);

I don’t have anything other than the pinMode command and a Serial.begin command in the void setup

void setup() 
{
  for(int ledPin = 10; ledPin <= 13; ledPin ++)
  {
    pinMode(ledPin, OUTPUT);
  }
  Serial.begin(9600);

this keeps giving me an error that says
“invalid conversion from ‘long int*’ to ‘uint8_t {aka unsigned char}’ [-fpermissive]”
I would like to know what this error means, how to alter my code to make this work, or if there is a better way to make this work. Also if tis wont work that would be a good thing to know. I would really appreciate any help you can give me.

Thanks

(for and delay code)

int ledPin;
int delayTime = 1000;
int roundCount = 0;
int lights[]{10, 11, 12, 13};
boolean correct = true;
//use strings for sequence comparison

long randNum;

void setup() 
{
  for(int ledPin = 10; ledPin <= 13; ledPin ++)
  {
    pinMode(ledPin, OUTPUT);
  }
  Serial.begin(9600);
}

void loop() 
{
 while(roundCount < 10)
 {
  //Serial.println(roundCount);
  //Serial.println(delayTime);
    for(int loopRun = 0; loopRun <= roundCount; loopRun++)
    {
      Serial.println(loopRun);
      randNum = random(10, 14);
      Serial.println(randNum);
      ledPin = randNum;
      
      digitalWrite(ledPin, HIGH);
      delay(delayTime);
      digitalWrite(ledPin, LOW);
      delay(delayTime);
    }
  for(int leds = 10; leds <= 13; leds ++)
  {
    digitalWrite(leds, HIGH);
  }
    delay(1000);
  for(int leds = 10; leds <= 13; leds ++)
  {
    digitalWrite(leds, LOW);
  }
  delay(1000);
  delayTime = delayTime - 50;
  roundCount = roundCount + 1;
 }
 digitalWrite(ledPin, LOW);
}

(array code)

int roundCount = 0;
int randNum;
int delayTime = 1000; 
int ledPin = 0;
int lightPins[5] = {10, 11, 12, 13};

void setup() 
{
  for(int ledPin = 10; ledPin <= 13; ledPin ++)
  {
    pinMode(ledPin, OUTPUT);
  }
  Serial.begin(9600);
}

void loop() 
{
  while(roundCount <= 5)
  {
    //prints the runCount variable then starts a new line
    Serial.print(roundCount);
    Serial.println(",");
    delay(500);
    for(int loopOne = 1; loopOne <= roundCount; loopOne++)
    {
      //generates number, prints the number and assigns it as the led pin value
      randNum = random(10, 14);
      ledPin = randNum;
      Serial.print(randNum);
      Serial.print(",");
      //activates led
      digitalWrite(ledPin, HIGH);
      delay(delayTime);
      digitalWrite(ledPin, LOW);
      delay(delayTime);
    }
    Serial.println("");
    delay(500);
    //uses array lightPins to activate all leds
    digitalWrite(lightPins, HIGH);
    delay(delayTime);
    digitalWrite(lightPins, LOW);
    delay(delayTime);
    
    Serial.println("");
    delay(500);
    roundCount ++;
    delayTime = delayTime - 70;
  }

}

You seem to understand that you need a for loop to set the pins one at a time. The same goes for the digitalWrite line. You can't set multiple pins with one digitalWrite statement.

The error message is telling you that you've given the wrong type of argument to digitalWrite. digitalWrite expects the first argument to be an integer. But you have supplied a pointer to an integer. An array name without any brackets and index behind it is just a pointer to the first element of the array.

Thanks for the advice. I just want to make sure, I have to use the for loop and the array can't be used this way. Or am I formatting the array incorrectly to preform in this way?

You’ve got some syntax problems

5 elements declared, but only 4 defined:
int lightPins[5] = {10, 11, 12, 13};
Change 5 to 4, or add one more IO pin. Elements will then be lightPins[0] to lightPins[4] (with 5 elements)

Array syntax not used here:
for(int ledPin = 10; ledPin <= 13; ledPin ++)
{
pinMode(ledPin, OUTPUT);
}

Should be
for(int ledPin = 0; ledPin <5; ledPin ++)
{
pinMode(lightPins[ledPin], OUTPUT);
}

Etc.