I have a master and a slave arduino (common ground) and a servo that should either be controlled by the master or the slave. They never control it in parallel, so only 1 of them sets the PWM signal. While not in control I can set the pin to detach() on the passiv Arduino. Is it OK to simply connect the signal wires from both Arduinos to the servo or do I need to add a switch? I do have a digital Out Signal from the master to the slave to inform it about the mode. If I need a switch could you please specify what I need to purchase and implement?
Bad idea overall!
Just have one Arduino control the servo, and the other one can send it cues as required.
Agree that my intended setup is problematic but am restricted in controlling the master arduino as it is itself a front end of a software package. That software package allows me to set or detach a pin but not to foreward a servo command.
We need to know more about your setup.
The logic state of a detached pin needs to be defined before we can answer this question. That is is the detached pin an output at a fixed logic level or does it default back to an input?