dkinzer Site Admin
Joined: 03 Sep 2005
Location: Portland, OR
|
|
Posted: 07 June 2007, 0:16 AM Post subject: Matrix Keypad Interface Using I2C |
|
|
I've created an example of how to connect a matrix keypad to a ZX using a PCF8574A I/O expander on the I2C bus. If you have other I2C devices already attached, the keypad can be added without using any additional I/O lines.
The circuit schematic for the connection and example source code are attached. The code implements auto-repeat but does not handle "multi-key rollover". It implements a polling technique but you could use the interrupt output of the PCF8574A to implement an interrupt-based interface. I haven't thought through how you would implement auto-repeat in this case but it could probably be done using WaitForInterval() to implement the check for the key-still-down condition.
| Description: |
| Keypad Interface Source Code |
|
 Download |
| Filename: |
i2c_matrix_keypad.zip |
| Filesize: |
2.9 KB |
| Downloaded: |
950 Time(s) |
| Description: |
|
 Download |
| Filename: |
i2c_matrix_keypad.jpg |
| Filesize: |
39 KB |
| Downloaded: |
1004 Time(s) |
|
|