If the pin is an output then presumably the program sets it HIGH or LOW. Save this state in a variable when you do the digitalWrite() to the pin and use it later when you need to know the current state. No need for digitalRead() at all.
If the pin is an output then presumably the program sets it HIGH or LOW. Save this state in a variable when you do the digitalWrite() to the pin and use it later when you need to know the current state. No need for digitalRead() at all.