Introduction
The 4x4 Keypad is a general purpose 16 button (4x4) matrix keypad. It comes ready to work, simply peel-off the adhesive backing, stick it to your surface and plug it in.
User guides
This is a simple application of port manipulation using Arduino to paly with the 4*4 button pad. Before read the code, you'd better see the connection diagram first. We use four digital ports as HIGH voltage scanning the row of button pad and four analog ports to read the column of button pad connected with four pull-down resistors. If button is pressed,the voltage will be HIGH when it is scanned by HIGH voltage concurrently. Otherwise, the voltage is pulled down and will be LOW. Using eight ports totally, we can read 16 buttons.
Connecting Diagram
Sample Code
Advanced application
Though the previous sample code can drive the button pad. However, this method wastes eight I/O ports. We strongly recommend an other product GPIO, which transforms between parallel and serial data transmission mode. Thus, with a GPIO, we can expand at most 16 I/O ports only using an IIC interface. We have written a more useful code to drive this button pad with a GPIO. Only two I/O ports of Arduino board are used using IIC interface.(Analog 4 for SDA(data) and analog 5 for SCL(clock)) Let's see details in GPIO wiki.