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.