sorry wrong code.
here is my code..
#include <Keypad.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 37, 35, 33, 31, 29, 27, 25, 23);
int backlight = 41;
boolean ledPin_state;
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
byte colPins[COLS] = { 44, 42, 40, 38 };
byte rowPins[ROWS] = { 52, 50, 48, 46 };
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup()
{
Serial.begin(9600);
lcd.begin(20,4);
pinMode(backlight, OUTPUT);
digitalWrite(backlight, HIGH);
lcd.clear();
ledPin_state = digitalRead(backlight);
keypad.addEventListener(keypadEvent);
}
void loop()
{
char key = keypad.getKey();
}
void keypadEvent(KeypadEvent key){
switch (keypad.getState()){
case PRESSED:
switch (key){
case 'B':
if (key == 'B') {
digitalWrite(backlight,!digitalRead(backlight));
ledPin_state = digitalRead(backlight);
}
break;
case '*':
if (key == '*'){
lcd.setCursor(0,1);
lcd.print("Enter Pass Code:");
lcd.setCursor(0,2);
lcd.print(key);
}
}
}
}
what i want here is, if the user presses '' the user should enter his/her password (he/she can press any key, in this case i cannot because only '' is recognized) and after entering the correct password he/she must press the '*' again to verify his/her password.. thank you for the kind help 