Corrected analogWrite function to be identical to pwmWrite