| ??? 09/20/06 01:56 Modified: 09/20/06 02:15 Read: times |
#124629 - Heavily unsuited! Responding to: ???'s previous message |
Mark said:
When no button is pressed, all row inputs are high .
All column outputs are low, because my code has told them to be. Yes, to detect by the help of AND-gate whether a key is just pressed at all and to leave idle mode. Mark said:
If I press a button, all columns are still low and one row is forced low by the button press. I then set the first column output high. So there will at this point be one column high and and the rest of the columns are still low.
I then look to see if the row input which was initially forced low by the button press is now forced high due to the button still being pressed and the column output being high. If not, I set the first column output low again and move to the next column output and start over. In this way, there is never more than one column output high at a time. This is highly unsuited!!! You can principally not detect which key is pressed, when the column is high, because then all rows are high at the same time. So, you must first set all the columns low to detect that a key was pressed at all, to look afterwards at which column that was. This needs much too much code for detecting succeeding key pressings (remember that you still have to debounce the keys, for instance by the help of vertical counters)! Or do you want to detect each single key pressing by this AND-gate interrupt?? The proper way to go is, to set all columns low, to be able to detect the pressing of a key and to leave idle mode, and then setting one and only one column low after the other (while all the other columns are high) to detect which key is just pressed. Kai |



