Errors in 4x4 Universal Keypad Code for Arduino Uno

Hello, I am am trying to write a sample program to verify that the keypad I have
is functional. I installed the keypad.h library and used the following code:

#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}; //connect to row pinouts 
byte colPins[COLS] = {6,7,8,9}; //connect to column pinouts

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);
  }
}

However, when I try to Verify the Code in a Sketch I receive the following error messages:

18:20 error: expected ‘.’ or ‘;’ before ‘=’ token
21:68 error: invalid conversion from ‘byte’ to ‘byte*’
21:71 error: initializing argument 2 of ‘Keypad::Keypad(char*, byte*, byte, byte)’
21:71 error: initializing argument 3 of ‘Keypad::Keypad(char*, byte*, byte, byte)’

What am I doing wrong?

I am pinning the Keypad from digital pin 2 through digital pin 9.

Thanks in advanced.

It compiles fine for me. I suspect you have a different Keypad library. Try downloading it again.

Thanks for the reply, it appears that I did indeed incorrectly instal the Keypad library into the Sketchbook/Libraries folder. I manually installed the Keypad Library into the Libraries folder, however, when unzipping the Keypad file the program duplicated the Keypad.h and Keypad.cpp and placed copies of these files alongside the main Keypad folder. Upon reinstalling the Library and rerunning the code it compiled without any errors.

Unfortunately although the code complied without a problem, the Serial Monitor does not respond to the keys "2", "3" and "A", All other keys output their respective values correctly. Not sure if this a problem with the pinning, the code, or with the keypad itself.

Thanks again for the response

[quote author=Futarime no Rikudo link=topic=180976.msg1341455#msg1341455 date=1375585065] Unfortunately although the code complied without a problem, the Serial Monitor does not respond to the keys "2", "3" and "A", All other keys output their respective values correctly. Not sure if this a problem with the pinning, the code, or with the keypad itself. [/quote]

Sounds like a bad connection or a bad keyboard. Check your wires.

try this and say.

#include <Keypad.h>

const byte ROWS = 4; // use 4X4 keypad for both instances
const byte COLS = 3;
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};
byte rowPins[ROWS] = {2,3,4,5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {6,7,8}; //connect to the column pinouts of the keypad
Keypad kpd( makeKeymap(keys), rowPins, colPins, ROWS, COLS );


const byte ROWSR = 4;
const byte COLSR = 1;
char keysR[ROWSR][COLSR] = {
  {'A'},
  {'B'},
  {'C'},
  {'A'}
 
};
byte rowPinsR[ROWSR] = {2,3,4,5};//connect to the row pinouts of the keypad
byte colPinsR[COLSR] = {9}; //connect to the column pinouts of the keypad
Keypad kpdR( makeKeymap(keysR), rowPinsR, colPinsR, ROWSR, COLSR );

void setup(){

  kpdR.begin( makeKeymap(keysR) );
  kpd.begin( makeKeymap(keys) );
  Serial.begin(9600);
  Serial.println( "start" );
}

char key, keyR ;
void loop()

{

  key = kpd.getKey( );

  if (key){
    Serial.println(key);
  }
  if( keyR ) {
    Serial.println( keyR );

}
}