Am I over expecting Arduino Scripts

HI,

Just starting to bury myself in Arduino after sitting on the sidelines to long

I have been trying to modify the Fade-in/Fade-out LED Script in “getting started with Arduino”, What I would like to do is to make 6 LEDs fade in and out, one after the other and then once working make it a “random” order

Ia m reasonably competent with C, so I have modifed the script as below:

const int LED = {3,5,6,9,10,11};
int i,j = 0;

void setup() {
//
for (j=1; j>6; j++)
{
pinMode(LED[j], OUTPUT);
}
}

void loop() {
//
for (j=1; j>6; j++)
{
for (i=0;i<255;i++)
{
analogWrite(LED[j],i);
delay(10);
}
}

for (j=1; j>6; j++)
{
for (i=255;i>0;i–)
{
analogWrite(LED[j],i);
delay(10);
}
}
}

I am getting the feeling that I cannot pass the PMW output as a variable, so will have to do it using a nested If…Then.Else or CASE statement

Would anyone in the hive-mind please put me right ?
Thank you

(deleted)

const int LED[] = {3,5,6,9,10,11};

Array index begin at 0 so this array runs from LED[0] to LED[5]

  for (j=1; j>6; j++) 
  {
    pinMode(LED[j], OUTPUT);
  }

This syntax is wrong, and should be

for (j=0; j<6; j++) 
  {
    pinMode(LED[j], OUTPUT);
  }

The same incorrect array handling also appears twice in loop().

const byte LED[6] = {3, 5, 6, 9, 10, 11};

void setup() {
  for (byte j = 0; j < 6; j++)
  {
    pinMode(LED[j], OUTPUT);
  }
}

void loop() {
  //
  for (byte j = 0; j < 6; j++)
  {
    for (byte i = 0; i < 255; i++)
    {
      analogWrite(LED[j], i);
      unsigned long _time = millis();
      const byte _delay = 10;
      while (_time - millis() < _delay) {}
    }
  }

  for (byte j = 0; j < 6; j++)
  {
    for (byte i = 255; i > 0; i--)
    {
      analogWrite(LED[j], i);
      unsigned long _time = millis();
      const byte _delay = 10;
      while (_time - millis() < _delay) {}
    }
  }
}

even though I`m not counting myself as competent in C programming language.

Sketch uses 1148 bytes (3%) of program storage space. Maximum is 32256 bytes.
Global variables use 15 bytes (0%) of dynamic memory, leaving 2033 bytes for local variables. Maximum is 2048 bytes.