lcd keypad

  int correct = strcmp(attempt, PIN);

If you enter 123456 on the keypad, correct will be 0;
If you enter 654321 on the keypad, correct will not be 0.

  for (int q=0; q<6; q++) 
  {
    if (attempt[q]==PIN[q])
    {
      correct++;
    }
  }

This is trying to do the same thing strcmp() is doing, except that strcmp() is smart enough to make sure that both strings are the same length. This code is NOT needed, and, having it, in fact, is wrong.