I have a sensor controlled by a Pico and a much larger embedded application controlled by a Raspberry Pi 4. When the Pico senses a condition, it raises a signal on a GPIO pin which I would like to detect on the Pi 4. The Pico and the PI4 are electrically connected by 5V power and ground -- the PI4 is powering the Pico -- but this may not always be the case. Is it safe in this case to simply connect a Pico GPIO output pin to a PI4 input pin? Would a resistor be needed? Should I use an opto-isolator instead? There are other situations in which the Pico would be separately powered because of distance from the pi; in this case, I suspect I'll have to build an opto-isolator module anyway.