I'm working with a Raspberry Pi. I want to be able to connect any two of 7 pins together in a matrix fashion to control a device with a keypad input. This means I need to be able to short any of the 3 horizontal pins to the other 4 vertical pins. I'm not sure if this can easily accomplished with the GPIO pins. Are there any IC's I can do this with or would I need to accomplish this with some kind of transistor?
If at all possible I would like it to be jellybean parts and as few parts as possible. If I can get away with 7 transistors or even just using the GPIO pins somehow that would be fine.
The easy solution is to use two analog 1:8 multiplexer chips. Connect both 8-sides to your 7 matrix pint (leaving one input unconnected), and the two 1-sides together. Now you can use the two 3-bit address\es to specify the two pins that must be conneced.
A much more difficult but no-components solution is depends on figuring out how the matric is used, presumably 3 or 4 pins are outputs from the controlling device, and the others are inputs. Use your GPIOs to sense what is output, and put the pattern that corresponds to the key you want pressed on the inputs (=your outputs). You must do this faster than the controlling device scans the keys.