Only certain pins can be used for AnalogWrite. A0 is not one of them. analogWrite() - Arduino Reference