Password project help

#include <LiquidCrystal.h>
#include <Wire.h>
#include <Password.h>
#include <Keypad.h>
#include <Servo.h>
//#include “RTClib.h”
Servo myservo;
int pos = 90;
//RTC_DS1307 RTC;
Password password = Password( “1” );
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] = {
46, 47, 48, 49};
byte colPins[COLS] = {
50, 51, 52, 53};

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

LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

int speakerPin = 35;
int alarmStatus = 0;
int zone = 0;
int alarmActive = 0;
int pirpin1 = 32;
int pirpin2 = 33;

void setup(){
Serial.begin(9600);
lcd.begin(20, 4);
Wire.begin();
// RTC.begin();

// RTC.adjust(DateTime(DATE, TIME));

myservo.attach(2);

/*displayCodeEntryScreen();
pinMode(redPin, OUTPUT);
pinMode(bluePin, OUTPUT);
pinMode(redLED, OUTPUT);
pinMode(greenLED, OUTPUT);
pinMode(speakerPin, OUTPUT);
pinMode(relay2, OUTPUT); //12V Blue LED lighting
pinMode(relay3, OUTPUT); //camera, 5V external DC supply
pinMode(relay4, OUTPUT); //

pinMode(pirPin1, INPUT); //Bedroom 2
pinMode(pirPin2, INPUT); //Garage
pinMode(reedPin1, INPUT); //Front door
pinMode(reedPin2, INPUT); //Back door

digitalWrite(redLED, LOW);
digitalWrite(greenLED, HIGH);
digitalWrite(speakerPin, LOW);

//digitalWrite(relay1, LOW); //
digitalWrite(relay2, HIGH); // 12V Blue LED lighting
digitalWrite(relay3, HIGH); // camera, 5V external DC supply
digitalWrite(relay4, LOW); //
*/
keypad.addEventListener(keypadEvent); //add an event listener for this keypad
myservo.write(pos);
}

void loop(){
/* DateTime now = RTC.now();
lcd.setCursor(0,1);
lcd.print(now.month(), DEC);
lcd.print(’/’);
//We print the day
lcd.print(now.day(), DEC);
lcd.print(’/’);
//We print the year
lcd.print(now.year(), DEC);
lcd.print(’ ‘);
lcd.setCursor(13,1);
lcd.print(now.hour(), DEC);
lcd.print(’:’);
lcd.setCursor(16,1);
lcd.print(now.minute(), DEC);
//lcd.print(’:’);
//lcd.print(now.second(), DEC);
//delay(1000);
/
keypad.getKey();
//Serial.println(digitalRead(reedPin2));
//Serial.println(digitalRead(pirPin));
//Serial.println(digitalRead(pirPin2));
if (alarmActive == 1){
if (digitalRead(pirpin1) == HIGH)
{
zone = 0;
alarmTriggered();
}
if (digitalRead(pirpin2) == HIGH)
{
zone = 1;
alarmTriggered();
}
}
}
void keypadEvent(KeypadEvent eKey){
switch (keypad.getState()){
case PRESSED:
if (passwd_pos - 15 >= 5) {
return ;
}
lcd.setCursor((passwd_pos++),0);
switch (eKey){
case ‘#’: //# is to validate password
passwd_pos = 15;
checkPassword();
break;
case '
’: //* is to reset password attempt
password.reset();
passwd_pos = 15;
break;
default:
password.append(eKey);
lcd.print("*");
}
}
}

void alarmTriggered(){
int expected_pos;
int incr;
digitalWrite(speakerPin, HIGH);
password.reset();
alarmStatus = 1;
alarmActive = 0;
lcd.clear();
lcd.setCursor(0,2);
lcd.print(" SYSTEM TRIGGERED “);
lcd.setCursor(0,4);
if (zone == 0)
{
lcd.print(” motion in hall ");
expected_pos = 65;
delay(1000);
}
if(zone == 1){
expected_pos = 40;
lcd.print("Motion in Bedroom ");
delay(1000);
}
if (expected_pos > pos) {
incr = 1;
} else {
incr = -1;
}

for (pos = pos; pos != expected_pos; pos += incr) {
myservo.write(pos); // tell servo to go to position in variable ‘pos’
delay(5); // waits 5ms for the servo to reach the position
}
void checkPassword(){ // To check if PIN is corrected, if not, retry!
if (password.evaluate())
{
if(alarmActive == 0 && alarmStatus == 0)
{
activate();
}
else if( alarmActive == 1 || alarmStatus == 1) {
deactivate();
}
}
else {
invalidCode();
}
}

void invalidCode()
{
password.reset();
lcd.clear();
lcd.setCursor(1,0);
lcd.print(“INVALID CODE! LOL!”);
lcd.setCursor(5,2);
lcd.print(“TRY AGAIN!”);
displayCodeEntryScreen();
}

void activate() // Activate the system if correct PIN entered and display message on the screen
{
lcd.setCursor(0,0);
lcd.print(“SYSTEM ACTIVE!”);
alarmActive = 1;
password.reset();
delay(2000);
}
else{
deactivate();
}
}

void deactivate()
{
alarmStatus = 0;
lcd.clear();
lcd.setCursor(0,0);
lcd.print(" SYSTEM DEACTIVATED!");
digitalWrite(speakerPin, LOW);
alarmActive = 0;
password.reset();
delay(5000);
displayCodeEntryScreen();
}

void displayCodeEntryScreen()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print(“Enter PIN:”);
lcd.setCursor(0,2);
lcd.print(“Home Security System”);
lcd.setCursor(0,3);
lcd.print(“istiyaq”);
}

plz help me out with correcting the errors passwrd_pos not declared in this scope

help me out with correcting the errors passwrd_pos not declared in this scope

I see no instance of "passwrd_pos", nor "password_pos", nor "password.pos" or anything like that.

What is the actual error message you get?

And why did you not use code tags? Please read "How to use this forum" sticky

  keypad.getKey();

See if there is a key pressed, while ignoring the return value. Why?

Do you also call digitalRead(), without saving the return value, just for the hell of it?

You have a global variable named 'pos' but the variable you try to use is named 'passwd_pos'. If those are supposed to be the same variable you should use the same name in both places.