Go Down

Topic: Trouble with a keypad (Read 457 times) previous topic - next topic


Feb 20, 2013, 11:20 pm Last Edit: Feb 20, 2013, 11:26 pm by Derkatwork Reason: 1
I have thoroughly read the other 4x4 keypad related threads in this forum and I'm still having trouble.  I'm using this keypad (http://www.amazon.com/Universial-Switch-Keypad-Keyboard-Arduino/dp/B008A30NW4).  I have the pins hooked up from left to right as 2,3,4,5,7,8,9,10 in the PWM area on an arduino ATMEGA 1280.  The code is as follows:
Code: [Select]
#include <Keypad.h>

const byte ROWS=4;
const byte COLS=4;


byte rowPINS[ROWS]={2,3,4,5};
byte colPINS[COLS]={7,8,9,10};

Keypad KEYPAD=Keypad(makeKeymap(KEYS),rowPINS,colPINS,ROWS,COLS);

void setup(){

void loop(){
 char KEY=KEYPAD.getKey();

 if(KEY != NO_KEY){

I'm not sure what the problem is and every tutorial says the same thing.  I just got the keypad in the mail today.  I'll explore google a little more while I'm waiting, but any help is greatly appreciated.  Thanks in advance.

EDIT: Forgot to mention a big part.  When hooking up to my computer, I open the serial monitor and nothing is displayed when a key is pressed.  I have looked at this thread (http://arduino.cc/forum/index.php/topic,112078.0.html), and near the bottom of the first page, I have seen the wire diagram they advised.  I did try this and the same nothing was what I got.


I've got one of those hooked to a Mega 2560 laying right here on the arm of my chair.

The 4 traces on the right are the column pins. The 4 traces on the left are the row pins.

Mine is working perfectly. Double check your wiring is all I can suggest.


I'm going to try with different wires. I did double check my wiring.  After that, I'll contact amazon and try to return/get a new keypad.  That's all I can think of that's left.  Again, the wires are in the places I stated in the code.  So even if they weren't in the correct spots, I would still get some output (even if it's the wrong one).

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131