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() {
Serial.begin(9600);
Wire.begin();
lcd.begin(16, 2);
lcd.setCursor(0,0);
pinMode(buttonPin, INPUT);
kpd.init();
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.setCursor(0,0);
lcd.print("5 ");
break;
case '9':
lcd.setCursor(0,0);
lcd.print("9 ");
break;
default:
Serial.println(key);
}
}
void keypadEvent(KeypadEvent eKey){
}
And i need to I connect this code
/*
||
|| @file PasswordKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | A simple password application that uses a keypad as input source.
|| #
||
*/
//http://www.arduino.cc/playground/uploads/Code/Password.zip
#include <Password.h>
//http://www.arduino.cc/playground/uploads/Code/Keypad.zip
#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
Serial.begin(9600);
keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}
void loop(){
keypad.getKey();
}
//take care of some special events
void keypadEvent(KeypadEvent eKey){
switch (eKey){
case '*': guessPassword(); break;
case '#': password.reset(); break;
default:
password.append(eKey);
}
}
void guessPassword(){
if (password.evaluate()){
digitalWrite(ledPin,HIGH);
}else{
digitalWrite(ledPin,LOW);
}
}
When I have insert this ( void keypadEvent(KeypadEvent eKey){)
I have the error
sorry I'am new in Arduino