Newb: Integrate with Keypad...need help

I'm trying to follow the playground tutorial

I'm not really sure how to capture the keypad pins correctly since I had multiple values for the rows and columns as I walked through the pins with the volt meter...One thing that throws me is that they show only 4 values for pins (3 cols and 4 rows) but when I test things I seem to get multiple values for rows and columns and ultimately came up with 10 values for the 10 pins of the keypad.

Another thing I was wondering is about the mention of pullup resistors...Do I put resistors in-line before sending the connection to the Arduino for the cols? (again, sorry I'm new to this!)

So I guess I'm stuck on figuring out my keypad and mapping it to the code AND the wiring with the pullup resistors...

Does anyone have any photos of this wired up?

What keypad do you have?

I bought the Jameco (Jameco#:2082206) one.

It looks like the one displayed in the tutorial, however it has 10 pins in the back.

I really want to understand how to do this and figure out the pins since I'm a newb and am trying to figure all this stuff out...this feels like a bit of reverse engineering to me, but I'm not sure if I've approached it correctly.

Thank you!

I'd put a meter in continuity mode and see whats connected where before you hook it up to the Arduino.

I did...

So I am confused by the results:

Digit on Keypad Pins on Keypad


1,2

  • 3,2
    0 4,7
    7 6,7
    8 5,7
    9 4,8
    4 6,9
    5 5,9
    6 4,9
    1 6,10
    2 5,10
    3 4,10

columns (i guess) are: 1,2,4,5,6
rows are: 3,7,8,9,10 (I had 2 as well in the rows, but since its in col, I guess we remove it from this group)

So how do I make this work?? Is this even correct? The tutorial showed only 7 numbers but maybe thats just because its a different keypad...

*also still need to know how to use the resistors in the circuit...

thanks!

The rows are 1, 3, 4, 5, and 6. The columns are 2, 7, 8, 9, and 10. If your table is correct.

Although the number of rows and columns doesn't seem right. A 12 key pad should have 4 row and 3 column pins.

That is why I am confused...It seems 4/3 was what the tutorial had as well...So how do I proceed?? I mean is there another way to determine the correct pins? I used my meter and that is what I got for each key press...

I'd try setting 4, 5, and 6 as the column pins, and 7, 8, 9 and 10 as the row pins, since the only keys that don't use those row/column combinations are the # and * keys.

What about "pullup resistors"? Does that simply mean I put a reisstor inline before connecting to the Arduino?

That's what the playground says. I didn't use any, and my keypad worked just fine.

To be safe, though, you probably should use them on the 4 row pins. They go between the keypad row pin and the Arduino input pin.

Well this almost worked...

Keys 1,2,3,4,5,6,9 work perfectly!

Key 7="#"
Key 8="0"
Key 0="*"

and of course keys * and # do nothing....

So is there a way to use the real mappings with the keypad class?

If you look back at your list, pins 4, 5, and 6 go with pin 10 for buttons 1, 2, and 3.

Pins 4, 5, and 6 go with pin 9 for buttons 4, 5, and 6.

Pins 4 and 8 go together for button 9.

From that, I would have expected pins 5 and 6 to go with pin 8 for buttons 7 and 8, and I would have expected pins 4, 5, and 6 to go with pin 8 for buttons *, 0, and #.

I would double check with the multimeter the pin combinations that you listed.

The row, column values are used as indices into an array. If the pin combinations you recorded are correct, you simply need to make the array in the sketch that maps rows and columns to keys larger (to match the number of rows and columns you specified), and put the correct letter at the correct row, column location.

I got it! (finally!)

My multimeter settings were correct.

I increased the arrays and built the matrice the way I read it with the multimeter...

The last issue I had was using pin#1 so I changed it to #11 and all worked!

Here is what the pertinent code finally looks like:

const byte ROWS = 6; //six rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
{'X','3','2','1'},
{'X','6','5','4'},
{'X','9','X','X'},
{'X','0','8','7'},
{'*','X','X','X'},
{'#','X','X','X'},
};
byte rowPins[ROWS] = {10, 9, 8, 7,3,11}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {2, 4, 5, 6}; //connect to the column pinouts of the keypad

THANKS TO ALL!!!!