These Keypad Matrix use I2C to communicate, 2 pins are required to interface. The Keypad Matrix has an interrupt pin to provide fast detection of changes. This example shows the working of polling.