Reading and writing to the same Arduino Pin

Second, you have not explained what you why or how you want to modify it.

@UKHeliBob,
Yeah, I tried to explain that to the OP in the previous post. What he is really asking is how to control the fan based on temp and
he thought he should be checking the fan control pin but I explained it is easier to use flags for decision making.