Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the numbers from keypad #20

Closed
victorMartins2024 opened this issue Jun 10, 2024 · 3 comments
Closed

Problem with the numbers from keypad #20

victorMartins2024 opened this issue Jun 10, 2024 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@victorMartins2024
Copy link

victorMartins2024 commented Jun 10, 2024

I'm developing a project that uses a password system to enter other operating screens, so I can't enter the password, when you open the first key it gives a password error filled in.

void eng(){

  lcd.clear();
  lcd.setCursor(5, 1);
  lcd.print("PASSWORD:");
  lcd.setCursor(14, 3);
  lcd.print("#-SAIR");

  while (1) {

    char key = kpd.getChar();

    if (kpd.isPressed()) {
      vTaskDelay(20);
      if (key == 'C') {
        resetPassword();
      } else if (key == '#') {
        apx();
      } else if (key == 'D') {
        if (passvalue == true) {
          aprovadoPass();
          passvalue = false;
        }
      } else {
        processNumberKey(key);
      }
    }
  }
}`

void processNumberKey(char key){

  lcd.setCursor(a, 2);
  lcd.print("*");
  a++;

  if (a == 8) {
    a = 4;  // Tamanho da senha com 4 digitos "2552"
  }

  currentpasslen++;
  password.append(key);

  if (currentpasslen == maxpasslen) {
    aprovadoPass();
  }
}

(updated syntax highlighting)

@RobTillaart
Copy link
Owner

Sorry for the long delay, I missed the notifications.

@RobTillaart RobTillaart self-assigned this Jul 14, 2024
@RobTillaart
Copy link
Owner

RobTillaart commented Jul 14, 2024

@victorMartins2024
Is this problem still actual ? as it is 5 weeks old.

Can you post a minimal sketch that shows the problem?
The code you posted looks OK, however I am not able to recreate the issue.

@RobTillaart RobTillaart added the question Further information is requested label Jul 14, 2024
@RobTillaart
Copy link
Owner

As there is no answer to my question, I close the issue.
Feel free to reopen it if the problem still exists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants