What's wrong with my code?
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;
}