I need some help with a fan controller.

Your if else statement is not the way it should be done. You start with if then all the next statements conditions should be else if and end with an else