The more I think about it the more I confuse myself... In the attached circuit if I want to simulate the effect of SW1 (or SW2) closing to ground how do I set the MCU-pin? Connect to Terminal 2 of the SW to one MCU-pin, and via Pinmode-set to INPUT for high impedance when the SW is OPEN? And then DigitalWrite-LOW while in INPUT (for low impedance) to CLOSE the SW? Or I need to change Pinmode to OUTPUT and then LOW (for low impedance) to close the SW?
I think I got the NPN transistor "switch": connect Base to a pin and set Pinmode-OUTPUT-HIGH if I want the transistor to conduct to E from C. And then set to Pinmode INPUT (no pullup) for high impedance to stop it from conducting.