Hi,
I could do this if I write this :
pwmWrite(9, 5); but normally it must be like this : pwmWrite(9, 0); ( the correct instruction )
I'm not clear about your problem. Are you saying that pwmWrite(9,0) does not stop the fan running but pwmWrite(9,5) stops it?
Why are you using this library instead of the standard analogWrite() function?