problem with my code

can someone help me with my code? i’m a beginner to this and i’m having a hard time finding out what the problem is i want to make it so that when the push button is pressed all the LEDS turn on it says “invalid conversion from ‘int*’ to ‘unit8’” here’s my code

int button1Pin = 12; // pushbutton 1 pin
int button2Pin = -11; // pushbutton 2 pin
int ledPins = {2,3,4,5,6,7,8,9}; // Defines an array to store the pin numbers of the 8 LEDs.
int button1State, button2State; // variables to hold the pushbutton states

void setup()
{
// setup all 8 pins as OUTPUT - notice that the list is “indexed” with a base of 0.
pinMode(ledPins[0],OUTPUT); // ledPins[0] = 2
pinMode(ledPins[1],OUTPUT); // ledPins[1] = 3
pinMode(ledPins[2],OUTPUT); // ledPins[2] = 4
pinMode(ledPins[3],OUTPUT); // ledPins[3] = 5
pinMode(ledPins[4],OUTPUT); // ledPins[4] = 6
pinMode(ledPins[5],OUTPUT); // ledPins[5] = 7
pinMode(ledPins[6],OUTPUT); // ledPins[6] = 8
pinMode(ledPins[7],OUTPUT); // ledPins[7] = 9

// Set up the pushbutton pins to be an input:
pinMode(button1Pin, INPUT);
pinMode(button2Pin, INPUT);
}

void loop()
{
button1State = digitalRead(button1Pin);
button2State = digitalRead(button2Pin);

// if button1 or button 2 are pressed (but not both)
if (((button1State == LOW) && (button2State == HIGH)) || ((button1State == HIGH) && (button2State == LOW)))
{
digitalWrite(ledPins, HIGH); // turn the LED on
}
else
{
digitalWrite(ledPins, LOW); // turn the LED off
}
}

I see two things. First is button2Pin really suppose to be -11 instead of 11?

Second, the digitalWrite will not take the array to the best of my knowledge. You can add a loop to write the pins one at a time

digitalWrite(ledPins[i] ...

Please use code tags in future.
** **[code]** **
your code here
** **[/code]** **
will result in

 int button1Pin = 12;  // pushbutton 1 pin
 int button2Pin = -11;  // pushbutton 2 pin
 int ledPins[] = {2,3,4,5,6,7,8,9};   // Defines an array to store the pin numbers of the 8 LEDs.
int button1State, button2State;  // variables to hold the pushbutton states


void setup()
{
  // setup all 8 pins as OUTPUT - notice that the list is "indexed" with a base of 0.
  pinMode(ledPins[0],OUTPUT);  // ledPins[0] = 2
  pinMode(ledPins[1],OUTPUT);  // ledPins[1] = 3
  pinMode(ledPins[2],OUTPUT);  // ledPins[2] = 4
  pinMode(ledPins[3],OUTPUT);  // ledPins[3] = 5
  pinMode(ledPins[4],OUTPUT);  // ledPins[4] = 6
  pinMode(ledPins[5],OUTPUT);  // ledPins[5] = 7
  pinMode(ledPins[6],OUTPUT);  // ledPins[6] = 8
  pinMode(ledPins[7],OUTPUT);  // ledPins[7] = 9
 
  // Set up the pushbutton pins to be an input:
  pinMode(button1Pin, INPUT);
  pinMode(button2Pin, INPUT);
}

void loop()
{
  button1State = digitalRead(button1Pin);
  button2State = digitalRead(button2Pin);

  // if button1 or button 2 are pressed (but not both)
  if (((button1State == LOW) && (button2State == HIGH)) || ((button1State == HIGH) && (button2State == LOW)))
  {
    digitalWrite(ledPins, HIGH);  // turn the LED on
  }
  else
  {
    digitalWrite(ledPins, LOW);  // turn the LED off
  }
}

ledPins is an array of integers; digitalWrite expects a single integer. So you have to loop through the array.

In setup(), you can optimize your code a bit (your current code is not wrong!)

  for (int cnt = 0; cnt < 8; cnt++)
  {
    pinMode(ledPins[cnt], OUTPUT);
  }

and in the problematic code (e.g. where you set the pins HIGH)

  for (int cnt = 0; cnt < 8; cnt++)
  {
    digitalWrite(ledPins[cnt], HIGH);
  }