Hello,
I’m using the VM167 with a Matrix keyboard 4x4.
I’m using 1-4 digital for INPUTS (which are the lines) and 5-8 digital for OUTPUTS (which are the columns).
Now, when I press a key on the keyboard, I well receive the signal for the line but not the for the column (this one being an output, not an input !).
How can I resolve this problem to know what column is pressed ?
thanks.
FABIEN
Your program knows which column is ON. You only activate one column at a time, scan all lines, then activate the next column. Rinse and repeat.
Thanks for your reply.
Before you post the answer I tried another solution : When the column is detected, the 4 outputs become inputs and inputs become outputs, so I receive the line !
Both solutions seem to work. I don’t know whick is the best. But in both cases, if you push the button VERY fast, there is no time enough to detect what button was pushed…
But in real world, I guess people will push long enough on the button
Really thank for the answer.
FABIEN
This is inherently true for this sort of “matrix” keyboard design. The scan frequency limits the minimum time of a button press.
In theory a full speed USB device could activate four columns and read the resulting input lines 125 times per second. Taking into account that any “scan” frequency is supposed to be at least twice the maximum input signal, we are already somewhere around 20 button presses per second. That is rather slow.
This is a classic case where the micro controller can shine. With the right firmware, it can scan those lines thousands of times per second, but deliver over USB just “button press/release” events.
With the right firmware, of course.