Stereo VU Meter from Mono VU Meter

Hello to all,
I have used a code for a mono led vu meter and now i want to transform it into a stereo vu meter but i cannot succeed. I have searched on google but i find examples only for led strips and others. I want to use simple led's.

The original code is:

int led[5] = { 3, 4, 5, 6, 7}; /* Assign the pins for the leds*/
int right[5] = { 8, 9, 10, 11, 12}; /* Assign the pins for the leds*/
int leftChannel = 0;  // left channel input
int rightChannel = 1;  // left channel input
int left, right, i, e;

void setup()
{
for (i = 0; i < 10; i++)
  pinMode(led[i], OUTPUT);
  for (e = 0; e < 10; e++)
  pinMode(led[e], OUTPUT);
}

void loop()
{

left = analogRead(leftChannel);  // read the left channel
right = analogRead(rightChannel);  // read the left channel
left = left / 30;    // adjusts the sensitivity  
right = right / 30;    // adjusts the sensitivity  

// left = 1500;  // uncomment to test all leds light.
// left = 0;    // uncomment to check the leds are not lit when the input is 0.
//left
  if (left == 0)  // if the volume is 0 then turn off all leds
   {
   for(i = 0; i < 10; i++)
     {
     digitalWrite(led[i], LOW);
     }
  }

  else
  {
   for (i = 0; i < left; i++) // turn on the leds up to the volume level
    {
     digitalWrite(led[i], HIGH);
    }

    for(i = i; i < 10; i++)  // turn off the leds above the voltage level
     {
      digitalWrite(led[i], LOW);
     }
  }
  //right
    if (right == 0)  // if the volume is 0 then turn off all leds
   {
   for(e = 0; e < 10; e++)
     {
     digitalWrite(right[i], LOW);
     }
  }

  else
  {
   for (e = 0; e < right; e++) // turn on the leds up to the volume level
    {
     digitalWrite(right[i], HIGH);
    }

    for(e = e; e < 10; e++)  // turn off the leds above the voltage level
     {
      digitalWrite(led[i], LOW);
     }
  }
}

Now, the code modified by me (i want only 5 led's per channel) is:

int led[5] = { 3, 4, 5, 6, 7}; /* Assign the pins for the leds*/
int right[5] = { 8, 9, 10, 11, 12}; /* Assign the pins for the leds*/
int leftChannel = 0;  // left channel input
int rightChannel = 1;  // left channel input
int left, i;
int right, e;

void setup()
{
for (i = 0; i < 10; i++)
  pinMode(led[i], OUTPUT);
  for (e = 0; e < 10; e++)
  pinMode(led[e], OUTPUT);
}

void loop()
{

left = analogRead(leftChannel);  // read the left channel
right = analogRead(rightChannel);  // read the left channel
left = left / 30;    // adjusts the sensitivity  
right = right / 30;    // adjusts the sensitivity  

// left = 1500;  // uncomment to test all leds light.
// left = 0;    // uncomment to check the leds are not lit when the input is 0.
//left
  if (left == 0)  // if the volume is 0 then turn off all leds
   {
   for(i = 0; i < 10; i++)
     {
     digitalWrite(led[i], LOW);
     }
  }

  else
  {
   for (i = 0; i < left; i++) // turn on the leds up to the volume level
    {
     digitalWrite(led[i], HIGH);
    }

    for(i = i; i < 10; i++)  // turn off the leds above the voltage level
     {
      digitalWrite(led[i], LOW);
     }
  }
  //right
    if (right == 0)  // if the volume is 0 then turn off all leds
   {
   for(e = 0; e < 10; e++)
     {
     digitalWrite(right[i], LOW);
     }
  }

  else
  {
   for (e = 0; e < right; e++) // turn on the leds up to the volume level
    {
     digitalWrite(right[i], HIGH);
    }

    for(e = e; e < 10; e++)  // turn off the leds above the voltage level
     {
      digitalWrite(led[i], LOW);
     }
  }
}

but i get all kind of int errors.

Could someone PLEASE help me?
Thank you all in advance

Post the error messages.

If you only want 5 leds, why do you loop 10 times in some for-loops?

but i get all kind of int errors.

Maybe you'd like to enlighten us.

Here are the errors i get when i verify the sketch:
test_vu_metru_stereo:6: error: conflicting declaration 'int right'

int right, i;

^

C:\Users\ZECE\Documents\Arduino\test_vu_metru_stereo\test_vu_metru_stereo.ino:2:5: note: previous declaration as 'int right [5]'

int right[5] = { 8, 9, 10, 11, 12}; /* Assign the pins for the leds*/

^

test_vu_metru_stereo:6: error: redefinition of 'int i'

int right, i;

^

C:\Users\ZECE\Documents\Arduino\test_vu_metru_stereo\test_vu_metru_stereo.ino:5:11: note: 'int i' previously declared here

int left, i;

^

C:\Users\ZECE\Documents\Arduino\test_vu_metru_stereo\test_vu_metru_stereo.ino: In function 'void loop()':

test_vu_metru_stereo:20: error: incompatible types in assignment of 'int' to 'int [5]'

right = analogRead(rightChannel); // read the left channel

^

test_vu_metru_stereo:22: error: invalid operands of types 'int [5]' and 'int' to binary 'operator/'

right = right / 30; // adjusts the sensitivity

^

test_vu_metru_stereo:50: error: 'e' was not declared in this scope

for(e = 0; e < 50; e++)

^

test_vu_metru_stereo:58: error: 'e' was not declared in this scope

for (e = 0; e < right; e++) // turn on the leds up to the volume level

^

test_vu_metru_stereo:63: error: 'e' was not declared in this scope

for(e = e; e < 5; e++) // turn off the leds above the voltage level

^

exit status 1
conflicting declaration 'int right'

previous declaration as 'int right [5]'

Two variables with the same name in the same scope.
Don't do that.

'e' was not declared in this scope

You haven't told the compiler about your variable 'e'

nvalid operands of types 'int [5]' and 'int' to binary 'operator/'

You can't divide an array.

right = analogRead(rightChannel);  // read the left channelYou can't assign an int to an array.(stupid comment, BTW)

Ok, thank you all. I have succeded to modify it.
I have verifyed and compiled it with success.
He is the code:

int led[5] = { 3, 4, 5, 6, 7}; /* Assign the pins for the leds*/
int led1[5] = { 8, 9, 10, 11, 12}; /* Assign the pins for the leds*/
int leftChannel = 0;  // left channel input
int rightChannel = 1;  // left channel input
int left, i;
int right, e;

void setup()
{
for (i = 0; i < 5; i++)
  pinMode(led[i], OUTPUT);
  for (e = 0; e < 5; e++)
  pinMode(led[e], OUTPUT);
}

void loop()
{

left = analogRead(leftChannel);  // read the left channel
right = analogRead(rightChannel);  // read the left channel
left = left / 30;    // adjusts the sensitivity  
right = right / 30;    // adjusts the sensitivity  

// left = 1500;  // uncomment to test all leds light.
// left = 0;    // uncomment to check the leds are not lit when the input is 0.
//left
  if (left == 0)  // if the volume is 0 then turn off all leds
   {
   for(i = 0; i < 5; i++)
     {
     digitalWrite(led[i], LOW);
     }
  }

  else
  {
   for (i = 0; i < left; i++) // turn on the leds up to the volume level
    {
     digitalWrite(led[i], HIGH);
    }

    for(i = i; i < 5; i++)  // turn off the leds above the voltage level
     {
      digitalWrite(led[i], LOW);
     }
  }
  //right
    if (right == 0)  // if the volume is 0 then turn off all leds
   {
   for(e = 0; e < 5; e++)
     {
     digitalWrite(led1[e], LOW);
     }
  }

  else
  {
   for (e = 0; e < right; e++) // turn on the leds up to the volume level
    {
     digitalWrite(led1[e], HIGH);
    }

    for(e = e; e < 5; e++)  // turn off the leds above the voltage level
     {
      digitalWrite(led1[e], LOW);
     }
  }
}
for (i = 0; i < 5; i++)
  pinMode(led[i], OUTPUT);
  for (e = 0; e < 5; e++)
  pinMode(led[e], OUTPUT);
}

The Arduino only needs to be told once what the pinMode for a particular pin is.