# [Solved] 4x4 Matrix Keypad problem

`````` char hexaKeys[rows][cols] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}};

byte rowPins[rows] = {6,5,4,3}; //connect to the row pinouts of the keypad
byte colPins[cols] = {A2,A1,A0,A3}; //connect to the column pinouts of the keypad

``````

Certain key doesn't respond.

pin 1 to 4 of the keypad is connected to D6 to D3
pin 5 to 8 of the keypad is connected to A2,A1,A0 and A3 (8)

Certain key doesn't respond.

Exactly what keys are these. It is important to know.

{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}};

5 , 6 , B will give 1, 2, 3
8, 9, C will give 4, 5, 6
0, #, D will give 7, 8 , 9

The rest are not responding.

You did define "rows" and "cols", didn't you?

In general, we would need essentially the full code to figure out what is going on.

`````` #include <Keypad.h>

const byte rows = 4; //four rows
const byte cols = 4; //four columns
char hexaKeys[rows][cols] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}};

byte rowPins[rows] = {6,5,4,3}; //connect to the row pinouts of the keypad
byte colPins[cols] = {A2,A1,A0,A3}; //connect to the column pinouts of the keypad

void setup(){
Serial.begin(9600);
}

void loop(){

if (customKey){
Serial.println(customKey);
}
}
``````

Unable to use 4,7,* and 2,3,A on the keypad. No output

It sounds like you have miss wired it or made a mistake using the code.
So a photo of the wiring and the full code would give us a place to start.

Have you seen this way of using a keypad. It uses fewer I/O pins and a few diodes instead.
http://forum.arduino.cc/index.php?topic=141978.0;topicseen

thats the full code i am using.

the wiring.

Where's the schematic for your keypad? Are you sure it uses 6,5,4,3 for the rows and A2,A1,A0,A3 for the columns? The keypads I have read from right to left when you are looking at the top of them. So, the pins are COL3, COL2, COL1, COL0, ROW3, ROW2, ROW1, ROW0

There seems to be an extra connector at each end of your key pad. Are you sure that this is right. Have you tried moving the connectors one place to the left.

wizdum:
Where's the schematic for your keypad? Are you sure it uses 6,5,4,3 for the rows and A2,A1,A0,A3 for the columns? The keypads I have read from right to left when you are looking at the top of them. So, the pins are COL3, COL2, COL1, COL0, ROW3, ROW2, ROW1, ROW0

Thanks pal. Solved