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:
#include <Keypad.h>
const byte ROWS=4;
const byte COLS=4;
char KEYS[ROWS][COLS]={
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
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(){
Serial.begin(9600);}
void loop(){
char KEY=KEYPAD.getKey();
if(KEY != NO_KEY){
Serial.println(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.