I want to use a GPIO-out to talk to a GPIO-in... two different programs running on the same pi.
The program with the GPIO-in can be activated by either a button, or the other program... with the GPIO-out.
Right now I am using a relay module. The GPIO-out of activates the relay, relay's output, in parallel to the button, can send a signal to the other program.
Or should I be using an optocoupler? The only problem is it sometimes works and sometimes doesn't. I found a 3V relay module (because I was using a 5V before) and it doesn't seem to be much more reliable.
Right now I have something like this:
except my current iteration is using this 3V relay module that I found:
Is there a better way to connect an output to an input? Can I do it directly? To do that I guess I would have to make the input "active high" (if I am using the term correctly). Is it safe to go like this:
or should I be working harder to figure out when to pull up or down the input or output of the relay?