unity code for serial comm and fan control function