if(){} else{} if(){} VS if(){} else if(){} in PWM control
This is more a code syntax question. Could be offtopic, might be moved to stackoverflow.

if(){} else{} if(){} and if(){} else if(){} are different.
With correct indentation and brackets the issue is immediately visible:

if(){} else{} if(){}

if(condition){
  statement
}else{
  statement
}
if(condition){
  statement
}


And

if(){} else if(){}  

if(condition){
  statement
}else{
  if(condition){
    statement
  }
}