need help

i a new user .. now iam working in my graduating project.. i made automatic garage which you come with your car and creat password then the garage will take your car to put it in empty stage and place in the garage then when he can to take his car he must enter the password which he create before
so i want help in program .
after looking for about how can i make program allow the users of garage create an new password, i cant find it .. i just found how can i evlaute the password which already i wrote it in the program
like this

#include <Password.h>
#include <Keypad.h>
#include <LiquidCrystal.h>
 
Password password = Password( "123456" ); //This is our password
LiquidCrystal lcd(22, 24, 26, 28, 30, 32);
 
const byte ROWS = 4; // 4 rows
const byte COLS = 4; // 3 columns
// Define the Keymap
char keys[ROWS][COLS] = {
  {'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
 
byte rowPins[ROWS] = {34,36,38,40};// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = {42,44,46,48};// 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(8, OUTPUT);
  lcd.begin(16, 2);
  lcd.print(" Enter Password");
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}
 
void loop()
{
  lcd.setCursor(0, 1);
  keypad.getKey();
}
 
//check the keypad events
void keypadEvent(KeypadEvent keyPress)
{
  switch (keypad.getState())
  {
    case PRESSED:
    lcd.print(keyPress); //print the keypress
    switch (keyPress)
    {
      case '#':
            checkPassword();
          break;
 
          case '*':
            password.reset();
            digitalWrite(15, LOW);
            lcd.setCursor(0,1);
            lcd.print("                ");
          break;
 
          default:
          password.append(keyPress);
     }
  }
}
 
//check the entered password
void checkPassword(){
  if (password.evaluate()) //if password is correct
  {
    lcd.setCursor(0,1);
    lcd.print("Correct Password"); //print a message on serial monitor
    digitalWrite(8, HIGH); //turn ON an LED
    password.reset(); //reset password
  }
  else
  {
    lcd.setCursor(0,1);
    lcd.print(" Wrong Password"); //if password is wrong
    digitalWrite(8, HIGH); //blink an LED
    delay(1000);
    digitalWrite(8, LOW);
    delay(1000);
    digitalWrite(8, HIGH);
    delay(1000);
    digitalWrite(8, LOW);
    delay(1000);
    lcd.clear();
    password.reset(); //reset password
  }
}

please anyone help me
because i must to finish this project after 25 days :slight_smile:

thnxxx for every one

I don't know anything about that password library, but I was able to make my own password sketch. Mine can do multiple passwords, for multiple users.

My sketch uses an I2C LCD, so some tweaking may be needed.

/* 
 || @version 1.0
 || @author Andrew Mascolo
 ||
 || @description
 || Simple use of keypad, password and LCD
 */
#include <Keypad.h>
#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x20,20,4);
char Data[20]; // 20 is the number of chars it can hold
const int Usercount = 3;
char Master[2][7] = {
  {
    '1','3','5','4','2','6'                  }
  ,
  {
    '0','0','0','1','2','3'                  }
};

String User[Usercount] = {
  "Master","Andrew","INVALID"};
int currentCommand = 0;
int MasterCount = 6;
int good_Count = 0;
int user = 0;
boolean good,goodUser;
char customKey;

const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
  {
    '1','2','3'                        }
  ,
  {
    '4','5','6'                        }
  ,
  {
    '7','8','9'                        }
  ,
  {
    '*','0','#'                        }
};
byte rowPins[ROWS] = {
  2,3,4,5    }; //connect to the row pinouts of the keypad
byte colPins[COLS] = {
  10,9,8    }; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS); 

void setup(){
  lcd.init();                      // initialize the lcd 
  lcd.backlight();
}

void loop(){
  lcd.setCursor(0,0);
  lcd.print("Enter Password");
  customKey = customKeypad.getKey();
  if (customKey){
    Data[currentCommand] = customKey;
    lcd.setCursor(currentCommand,1);
    lcd.print(Data[currentCommand]);
    currentCommand++;
  }

  if(currentCommand == MasterCount){
    delay(1000);
    while(user != 2){
      for(int count = 0; count < MasterCount; count++){
        if(Data[count] == Master[user][count]) {
          good_Count++;
        }  
      }
      if(good_Count == MasterCount) {
        good_Count = 0;
        good = true; 
        break;
      }
      else { 
        good_Count = 0; 
        user++; 
        good = false;
      }
    }
    
    lcd.setCursor(0,0);
    if(good) {
      lcd.clear();
      lcd.print("Password is good");
      lcd.setCursor(0,1);
      lcd.print(User[user]);
      delay(2000);
      user = 0;
      lcd.clear();
      clearData(); 
    }
    else {
      lcd.clear();
      lcd.print("Password is bad");
      lcd.setCursor(0,1);
      lcd.print(User[user]);
      delay(2000);
      user = 0;
      lcd.clear();
      clearData();
    }
  }
  if(customKey == '*'){
    lcd.clear();
    clearData();
    while(goodUser != true){
      lcd.setCursor(0,0);
      lcd.print("Change Password");
      lcd.setCursor(0,1);
      lcd.print("Enter User: ");
      user = customKeypad.getKey();
      if(user){
        user -= '0'; // convert from char to int
        lcd.print(user);
        if(user < Usercount) { // if within number of users
          delay(1000);
          goodUser = true; //gets out of while loop
          user -= 1; // ENTER: 1 = master, 2 = user, but the array is 0 for master and 1 for user. This makes it so.
          lcd.clear();
        }
        else {
          delay(1000);
          lcd.clear();
          lcd.print("Invalid User");
          delay(2000);
          lcd.clear(); 
        }
      } 
    }
    goodUser = false;// stays in while loop
    while(customKey != '#'){
      lcd.setCursor(0,0);
      lcd.print(User[user]); // prints out the user
      customKey = customKeypad.getKey();
      if (customKey){
        Master[user][currentCommand] = customKey;
        lcd.setCursor(currentCommand,1);
        lcd.print(Master[user][currentCommand]);
        MasterCount = currentCommand;
        currentCommand++;
      }
    }
    if(customKey == '#') {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print(User[user]);
      lcd.print(" is reset");
      delay(1000);
      clearData();
      lcd.clear();
    }
  }
}
void clearData() {
  user=0;
  while(currentCommand !=0){   // This can be used for any array size, 
    Data[currentCommand--] = 0; //clear for new data
  }
  return;
}

Let me give you all an explanation as to why I did it this way,

char Master[2][7] = {
{
'1','3','5','4','2','6' }
,
{
'0','0','0','1','2','3' }
};

And not,

char Master[2][7] = {"135426", "000123"};

The reason is because when you try to change the password for master, "Master" becomes junk on the screen, however "Andrew" still shows perfectly. For some reason, it messes up the memory for the usernames, so to fix this problem (quick and dirty) I did it the long way.