??? 06/30/06 08:46 Read: times |
#119408 - general idea Responding to: ???'s previous message |
The general idea of matrix scanning is, that you put 0 on only one of the columns (and 1 on the remaining), and watch, which row goes down to 0 (assuming that there are some pullups which keep the remaining columns in 1).
Your code watches the rows and columns, but there is nothing that makes some of them going 0 (no instruction setting any pin to 0). You need to output the 0 onto some of the columns and then read in the rows. And, please, start with something really simple - don't attempt to read in multiple keys at once nor make fancy autorepeats. Simply, output onto your "debug" port (P2) what you detected that is pressed. Jan Waclawek PS. For how to post formatted code here, please read Jon Ledbetter's guide for newcomers to 8052.com, page 3, "Posting Code". |