if //(keypad.key[i].stateChanged) //case PRESSED:
(key == 'B')
{
if (input_password.length() > 0)
{
lcd.setCursor(input_password.length(), 1); // move cursor to the last added character
lcd.print(' '); // Replace it with a blank
input_password.remove(input_password.length() - 1);
}
}
I just want to limit the length of password to 3 digits and if we try to press after entering 3 digit
it ll simply not getting entered or displayed on screen
Create a variable to hold the count of characters entered. Increment the count each time a character is entered. If 3 or more, stop inputting from the keyboard until you need to enter another password. Then clear the count and start again.
Please post the whole program. Snippets are often less than helpful.