Lets say that I have a microcontroller (MC-A) with a digital input that is actuated by a switch. I have another microcontroller (MC-B) which I want to use to trigger the switch (as if the user pressed it). I assume that I cannot simply attach the digital out pin on MC-B to the digital input on MC-A. So I would need a relay or something which would allow MC-B to bypass the switch. Relays are slow, mechanical devices; my best guess is an optocoupler.
What kind of hardware switch would I need to do this? It needs to wait for the output pin on MC-B to go HIGH, and then allow current to flow and bypass the push button switch.
MC-A is running at 3 volts, and MC-B is running at 5 volts.
I am a complete newbie at this.