What is wrong with this code?

:~

int delayTime = 1000;
int ledPin = 13;

void setup()
{
  pinMode(ledPin, OUTPUT);
}
void loop()
{
  if(ledPin == 14)
  {
    ledPin = 9;
  }
  digitalWrite(ledPin, HIGH);
  delay(delayTime);
  ledPin += ledPin;
}

It compiles well but only pin 13 is always high and don't get the expected result i.e; scanning effect.

This is the first time I've tried something at this level on my own.

Expectation:
Pin 13 must be high for 1000 ms and then ledPin must be set to 14 and the if function must check the value and set it back to 9 and then 10, then 11, then 12, then 13, then 9 and so on again and again(Loop).

What really happens:
The pin 13 is always high.
I'm using Arduino 1.0

What the problem might be:
Maybe something with the if statement.

Please help me out.

How many pins have you made outputs?

ledPin += ledPin;

this will always add 13, your code will never enter the if statement

++ledPin;

this will increment by one

And AWOL has a point, only pin 13 is an output

int ledPin = 13;

void setup()
{
  pinMode(ledPin, OUTPUT);
}

Thanks guys. I get the not declaring other pins as outputs point but why is ledPin += ledPin going to work Pyro_46 ?

Because 13+13 = 26

Pins don't turn off automatically. Once you turn it on, it stays on. If you want it to go off, you must turn it off.

Look at this:

for (int i=9; i <= 13; i++){
      digitalWrite(ledPin[i], HIGH);
      delay(1000);
      digitalWrite(ledPin[i], LOW);
   }

Easy, clean and does the job!

Thanks guys.
Here's a summary of what I learnt from this post.

ledPin += ledPin = 2*ledPin NOT ledPin + 1

You have to set a pin low to turn it off.(LOL).

You have to declare every pin you're gonna as OUTPUT or INPUT use in void start().

I've also learnt how to use for command.