Checking the value of an output pin

I have scoured the forums for this answer and can’t seem to find it.

I have and pin set to OUTPUT for use with a relay. However I have multiple conditions that might make this pin go HIGH. What are my options to check if the pin is high or low.

I know every time I toggle the pin I can store a value that is set to the value of the pin but is there are more systematic way to check the status of a output pin like an internal register value?

This post on stack overflow states you can do it by reading the right bit on PORTD on the Arduino. Do I have that same option on a Photon?

Actually digitalRead(yourPin) should work for you, even though you have it set for OUTPUT

1 Like

Awesome, I didn’t think I could do that, but that is perfect. Thanks for the quick response @BulldogLowell