How can I insert the password.keypad example in my code ?

I have this code

#include <Wire.h>
#include <PCFCrystal.h>
#include <i2ckeypad.h>
#include <Password.h>

Password password = Password( "1234" );

byte buffer = 0;

PCFCrystal lcd(B00100000, B00010000, B00000001, B00000010, B00000100, B00001000, 0x39, &buffer);
const int buttonPin = 2;
int buttonState = 0; 

#define ROWS 4
#define COLS 4

#define PCF8574_ADDR 0x38

i2ckeypad kpd = i2ckeypad(PCF8574_ADDR, ROWS, COLS);

void setup() {
    lcd.begin(16, 2);

    pinMode(buttonPin, INPUT);

  Serial.print("Testing keypad/PCF8574 I2C port expander arduino lib\n\n");

void loop() {
  buttonState = digitalRead(buttonPin);


     char key = kpd.get_key();

  if(key) {
        switch (key)
      case '5':
    lcd.print("5                     ");
      case '9':
    lcd.print("9                       ");

  void keypadEvent(KeypadEvent eKey){

And i need to I connect this code

|| @file PasswordKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact
|| @description
|| | A simple password application that uses a keypad as input source.
|| #

#include <Password.h>
#include <Keypad.h> 

Password password = Password( "1234" );

byte rows = 4; //four rows
byte cols = 4; //four columns
byte rowPins[] = {2,3,4,5}; //connect to the row pinouts of the keypad
byte colPins[] = {6,7,8,9}; //connect to the column pinouts of the keypad

Keypad keypad = Keypad(rowPins,colPins,rows,cols);

const byte ledPin = 13; 

void setup(){
  pinMode(ledPin, OUTPUT);      // sets the digital pin as output
  digitalWrite(ledPin, HIGH);   // sets the LED on
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
void loop(){

//take care of some special events
void keypadEvent(KeypadEvent eKey){
  switch (eKey){
    case '*': guessPassword(); break;
    case '#': password.reset(); break;

void guessPassword(){
	if (password.evaluate()){

When I have insert this ( void keypadEvent(KeypadEvent eKey){)
I have the error

sorry I’am new in Arduino

I have the error

sorry I'am new in Arduino

That error is only correctable with experience.

Perhaps you meant a different error?

need I use the keypad.h ? i use the I2Ckeypad.h can I insert the password.h ?Is it possible?

need I use the keypad.h ? i use the I2Ckeypad.h

Use the one that goes with the keypad you have. If you have an I2C keypad, use the I2Ckeypad library. Otherwise, don't.

can I insert the password.h ?Is it possible?

Yes and yes.

I try to compile this two code but when I insert ( keypad.addEventListener(keypadEvent); ) I have this error

i2c_keypadand_lcd.cpp: In function 'void setup()':
i2c_keypadand_lcd:30: error: 'keypad' was not declared in this scope
i2c_keypadand_lcd:30: error: 'keypadEvent' was not declared in this scope

If,I understood correctly it is not included in I2ckeypad.h But it included in keypad.h please can you help me?

? tried to I edit the I2Ckeypad.h but I didn't I managed it . have someone any idea ? what must I try?

Did you achieve this? I want to do exactly what you wanted… <i2ckeypad.h> & <Password.h>

Good I speak two languages, I found the solution in Spanish… The only problem with the Library is 1.0 compatibility. You need to change in Password.h #include <WProgram.h> for #include <Arduino.h> and the library works great!