Help on password

Hello. So i wanted to try the passwork with keypad example and i added something new to the code but it doesnt seem to work. (the rest of the code is the same with the example )

void checkPassword(){
  if (password.evaluate()&&digitalRead(12)==HIGH&&digitalRead(11)==HIGH){
    Serial.println("Success");
    digitalWrite(13, HIGH);

The 12 and 11 are aleph magnetic contacts.So basically i want the led(13) to turn on when both the contacts are HIGH and the password is correct. Can someone tell me why isnt this working?

What is "password.evaluate"?

(the rest of the code is the same with the example )

Wuh?

AWOL:
What is "password.evaluate"?
Wuh?

I dont understand what you mean. If you mean what is the correct password it is 1234

You can help us by showing the wiring, or you can debug this yourself by using Serial.println to print the values of digitalRead(11), digitalRead(12), and password.evaluate().

Post your code

/*
||  Simple Password Entry Using Matrix Keypad
||  4/5/2012 Updates Nathan Sobieck: Nathan@Sobisource.com
||
*/


//* is to validate password   
//# is to reset password attempt

/////////////////////////////////////////////////////////////////

#include <Password.h> //http://www.arduino.cc/playground/uploads/Code/Password.zip
#include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip

Password password = Password( "1234" );

const byte ROWS = 4; // Four rows
const byte COLS = 3; //  columns
// Define the Keymap
char keys[ROWS][COLS] = {
  {'1','2','3'},
  {'4','5','6'},
  {'7','8','9'},
  {'*','0','#'}
};

byte rowPins[ROWS] = { 8,7,6,5 };// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = { 4,3,2, };// Connect keypad COL0, COL1 and COL2 to these Arduino pins.


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

void setup(){
   pinMode(13, OUTPUT);
   pinMode(12, INPUT);
   pinMode(11, INPUT);
  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 (keypad.getState()){
    case PRESSED:
 Serial.print("Pressed: ");
 Serial.println(eKey);
 switch (eKey){
  case '*': checkPassword(); break;
  case '#': password.reset(); break;
  default: password.append(eKey);
     }
  }
}

void checkPassword(){
  if (password.evaluate() && digitalRead(12)==HIGH && digitalRead(11)==HIGH){
    Serial.println("Success");
    digitalWrite(13, HIGH);
  }else{
    Serial.println("Wrong");
    //add code to run if it did not work
  }
}

How are pins 11 and 13 connected?

What happens when you tie them high?

AWOL:
How are pins 11 and 13 connected?

What happens when you tie them high?

a magnetic contact is connected to pin 11 and ground(like the magnetic contact at 12) and a led is connected to pin 13 and ground. When the magnetic contact is HIGH it means that the electromagnet and the magnet are touching each other. And the led when it is HIGH it emmits light. Even though they are touching one another the led still doesnt turn on.

What is "a magnetic contact"?

AWOL:
What is "a magnetic contact"?

Aleph magnetic contact. I cant explain it but if you google it im sure you can find out what it is. It is used in security systems
.

(deleted)

spycatcher2k:
What does your multi-meter measure on these pins?

Your comment made me figure out what i should have done. On void setup i should have put pin 12 and pin 11 to HIGH. So now its all good thanks all of you for your time