hi,
tnx in advance for your help
Im building some security system, I use:
keypad.h
password.h
libraries
in the next example (from password librarie),
http://www.arduino.cc/playground/Code/Password
I get the next error just out of examples, PasswordKeypad.pde
error: no matching function for call to 'Keypad::Keypad(byte [4], byte [4], byte&, byte&)'/windows/LinuxProgramas/arduino-0017/hardware/libraries/Keypad/Keypad.h:63: note: candidates are: Keypad::Keypad(char*, byte*, byte*, byte, byte)
/windows/LinuxProgramas/arduino-0017/hardware/libraries/Keypad/Keypad.h:57: note: Keypad::Keypad(const Keypad&)
if I fix it for working with the keyboard, it compiles, but not working, I will need as well some messages for serial to know if it got the right password???
here is the code that compiles, but how does it work??
the led just goes off if I press *
sorry if its a stupid question but I only see the loop calling the keypad.getkey(), how does it compare the password?
tnx
/*
||
|| @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.
|| #
||
*///Arduino Playground - HomePage
#include <Password.h>
//Arduino Playground - HomePage
#include <Keypad.h>Password password = Password( "1234" );
const byte ROWS = 4; // Four rows
const byte COLS = 4; // columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = { 7, 6, 5, 4 };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
byte colPins[COLS] = { 12, 11, 10, 8 };// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );#define ledPin 13
void setup(){
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);
Serial.print("bien");
}else{
digitalWrite(ledPin,LOW);
}
}
tnx