help with function

hi.I want to make KNIGHT RIDER.i write LedOff() function to turn off leds.it work well.but i cant write LedsOn() function please help me.I want something like this
LedsOn(2); led 2 turns on
LedsOn(2,3); led 2 and led 3 turns on
LedsOn(2,3,4,5,6,7); led 2,3,4,5,6,7 turns on

this code work fine

int pinArray[] = {6, 10, 13,};

void setup(){
  for (int count=0;count<3;count++) {
    pinMode(pinArray[count], OUTPUT);
  }
}

void loop() {
  digitalWrite(6, HIGH);
  delay(1000);
  LedsOff();
  
  digitalWrite(6, HIGH);
  digitalWrite(10, HIGH);
  delay(1000);
  LedsOff();
  
  digitalWrite(6, HIGH);
  digitalWrite(10, HIGH);
  digitalWrite(13, HIGH);
  delay(1000);
  LedsOff();
  
  digitalWrite(13, HIGH);
  delay(1000);
  LedsOff();
  
  digitalWrite(10, HIGH);
  delay(1000);
  LedsOff();
  
  digitalWrite(6, HIGH);
  delay(1000);
  LedsOff();
  
}

void LedsOff(void)
{
  for (int count=0;count<3;count++) {
    digitalWrite(pinArray[count], LOW);
  }
}

but in this code i get error INVALID CONVERSION FROM ‘INT’ to ‘int*’

int pinArray[] = {6, 10, 13,};

void setup(){
  for (int count=0;count<3;count++) {
    pinMode(pinArray[count], OUTPUT);
  }
}

void loop() {
  
  LedsOn(6);
  delay(1000);
  LedsOff();
  
  LedsOn(6,10);
  delay(1000);
  LedsOff();
  
  LedsOn(6,10,13);
  delay(1000);
  LedsOff();
  
}

void LedsOff(void)
{
  for (int count=0;count<3;count++) {
    digitalWrite(pinArray[count], LOW);
  }
}

void LedsOn(int pinAray[3])
{
  for (int counts=0;counts<3;counts++) {
    digitalWrite(pinAray[counts], HIGH);
  }
}

digitalWrite(pinAray[counts], HIGH);spelling?

I dont understand what you say.can you write correct function.thanks

Array != Aray
I don’t understand why you pass one function an array pointer, but not to the other.
LedsOn(6,10,13); There are no function overloads visible. Did you post all your code?

my LedsOn function is

void LedsOn(int pinAray[3])
{
  for (int counts=0;counts<3;counts++) {
    digitalWrite(pinAray[counts], HIGH);
  }
}

LedsOn(6,10,13);so why call it like that, if there's no overload?

please write correct form .how it should be???

how it should be?

I don't know - I don't understand the form of the call you're using.

void LedsOn(int pinAray[3])

What you're saying here is When I call you, I'm going to send you an array of ints, which will be represented by the address of the first element.

LedsOn(6,10,13);

But when you call it, you're saying Here are three, independent int variables for you to use.

You need to package the values you want to send in an array, and send the array as the argument. Since it looks like you aren't going to be only sending three values, I would also pass it the number of pins you are sending it.

how solve this problem?

farsajik:
how solve this problem?

By doing what I said, pack the pins in an array and send it to the function.

.and if the array is shorter than the function expects, don't forget to send the length.
Or use a bit mask.

i am new in arduino programming.can you show me some example how do it.thanks for anwering