• Thank you @Gordon for such detailed explanation.

    I have used the LED example but in fact my use case is a bit different. So I have a bunch of things toggling a relay from a number of places in the code. Then there is other things logic depending on relay's state, so I want to check if it's on or off.

    Now I could simply use a variable just like you suggested but it adds this overhead of keeping it in sync with a real state - as I said in multiple places of the code. I just feel more confident when operating directly on a given pin with Pin.write and - I wish - Pin.read.

    I hope you will change your mind and see some value in adding something like readOutputValue :)


Avatar for Rollo @Rollo started