I'm working on piece of software for Raspberry Pi and I'm writing an integration test. One of the cases requires that I'm able to read a state of one pin on another (basically if one output pin is high - another input pin should also be high, and vice-versa).
What's the safest way to connect one pin to another so that:
a) Regardless of software settings (Pin is out/in, high or low), there's never a dangerous short.
b) The state of the IN pin is never "floating" (which is the reason for using pull-downs/pull-ups from what I understood)
simulate this circuit – Schematic created using CircuitLab
Basically is R2 needed?