Need help in change password

I have a security system which needs a password. So in settings it will change the default password. But when I am changing password even it says password changed after it restarts the display is still in current password, it doesn't display the input password. Hope you can help me. Thanks!

This is the code
https://pastebin.com/cVppfdsp

How?

hello I think the problem is here when it clears cpw it goes back to that condition and still displays the current password even after I changed the password. It should display the enter the password I don't where I went wrong

bool checkCurrent(){
  if(cpw.length() < 6 | cpw.length() > 6){
          printConfirm(F("------------------"), F("Password should be"), F("be........"));
          delay(900);
          printConfirm(F("------------------"), F("     6 "),F("character long"));
          delay(900);
          
          clearcpw(cpw);
          return false;

  }
  else if(cpw == dpw){
     cpw = "";
     return true;
 
    }
  else
     printConfirm(F("------------------"),F("Current password"),F("does not match!"));
     delay(500);
     clearcpw(cpw);
     
     return false;
    
 }

Post.
All.
Your.
Code.

1 Like

Hello
The sketch won´t compile.

https://pastebin.com/cVppfdsp

Where in your code are the following functions defined?

clearchpw()
deletechpw()
hidechpw()

Where in your code is the new password stored in non-volatile memory?

Post the complete code here. Few people will go to random web sites of unknown provenance just to help someone for free.

1 Like

OK, back to my previous question:

in dpw

"dpw" is just a variable. No variables survive a restart / power cycle. Anything you want saved must be saved in non-volatile memory. Start your Google search with "Arduino EEPROM".

You probably meant '||' (logical OR) instead of '|' (bitwise OR). This mistake is in two places.

printConfirm(), and printMenu() return 'int' but have no 'return' statement.

If 'attempt' is >2 when entering 'check()' you will reach the end of the function without hitting a 'return' statement.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.