XY-problem
I have a keyboard that consists of two halves. Each half uses 16 pins. The pins in each half are aligned in a 8x8 matrix yielding 64 key presses that can be detected, and two times 64=128 keys in total. I can set a value on GPIO pin 8, and then read out the value on GPIO pin 9 to determine whether the key on the intersection of 8 and 9 is pressed. The values are identical if there is a connection between GPIO pin 8 and 9. A keypress realises such a connection.
Example Code
After using the following script to detect a connection between two GPIO pins (GPIO pin 8 and GPIO pin 9) on a Raspberry Pico:
from machine import Pin
import time
led = Pin(15, Pin.OUT)
output_line= Pin(8, Pin.OUT)
input_line = Pin(9, Pin.IN, Pin.PULL_DOWN)
while True:
time.sleep(2)
if(input_line.value()):
led.toggle()
time.sleep(0.5)
print("connected")
output_line.value(1)
print("set high")
Issue
The pico however does not have 2 times 16 GPIO pins but 26 (25 excluding the led I think). Which means it does not have enough pins for two 8x8 matrices (which require two times 8+8=32 pins). So I am looking for another 7 pins that I can set values to, or read values/connections from on other pins, to get 32 pins on which the two keyboard matrices connections/keypresses can be detected.
Solution Attempts: Software
So I tried setting the value of pin 25 and reading out the value of pin 26, however, that disconnects the Pico when I try to find that connection, for example when I connect GPIO27_A1
to AGND
.
Solution Attempt: Software Example
An example I had in mind was: I assume the 3V3 sets some value/voltage, e.g. 3 Volts. I assumed that if I connect the 3V3
pin to a GPIO pin 10
, and read out the value of 10
, it would be False
if it is not connected to 3V3
, and True
if it is connected to 3V3
. If those assumptions are valid, that would grant me another row/pin from which I can read off key presses.
Solution Strategy: Hardware
So I could either buy cables that allow me to connect two jumper cables to a single pin, and then send those pulses/values to the left and right half of the keyboard, (multiplying the signals of the first 8 GPIO pins by two), and using another 16 pins to read out the values.
However, I was having some difficulty in finding single female to double female jumper cables, and thought it would be more elegant to not buy extra material if I can squeeze the functionality out of the board itself.
Question
Hence, I would like to ask: Is it possible to also determine connections*/(logic levels) between non-GPIO pins (and GPIO pins) in some way?
*This assumes that I am aware that there is just a single wire going from one pin to another, meaning, if the values/voltages on two pins is identical (and manually set on 1 of the two), I assume there is a connection.