What's wrong with my code? I was trying to do a LED display that turns on a LED at pin 13 that goes on then turns off after a delay then the next pin (which is pin 12 counting down) will turn on and then turn off.

I also put in a potentiometer that can change the delay to make it faster or slower.

Here's the code:

float pinOn = 13;
int outMin = 0;
int outMax = 13;
float delayNum = 1000;

void setup () {
  for (int i=outMin; i&lt;=outMax; i++) {
  pinMode(i, OUTPUT); }
  Serial.begin(9600);
}

void loop () {
  // Reads Potentiometer -- sets delay relative to the Potentiometer input
  int sensorValue = analogRead(A0);
  delayNum = sensorValue;
  // Turns on the Pin designated by 'pinOn'
  digitalWrite(pinOn, HIGH);
  delay(delayNum);
  digitalWrite(pinOn, LOW);
  // Checks if 'pinOn' is 0 which then resets it back to 13 if not 0 then counts down
  if (pinOn = 0) {
    pinOn + 13;
  } else {
    pinOn - 1;
  }
}


All it does is turn on pin 13 for a moment then permanently turns on pin 1 and 0 and it gets stuck like that.
if (pinOn = 0) is doing an assignment (single =) not a comparison (double ==), so pinOn is begin set to 0 each time through the loop. The result of an assignment is the value being assigned. So it's the same as if ( 0 ), which is false. 

Now, on to the two branches. pinOn + 13 is a statement and the result is not being assigned to anything. You need an equals sign somewhere:

if (pinOn == 0) { // == means "is equal to" 
  pinOn += 13; // same as pinOn = pinOn + 13
}
else {
  pinOn -= 1;
}