Added function to write fan speed to file