Yes Hamfests are dangerous to me and my wallet

Here is an update I meshed together a couple different sketches to finally get this one working. Eventually "lockpin" will be a servo or actuator to lock a drawer or something. I just started teaching myself this stuff to go along with the two degrees I am going after.
/*
|| Simple Password Entry Using Matrix Keypad
|| 4/5/2012 Updates Nathan Sobieck: Nathan@Sobisource.com
||
*/
//* is to validate password
//# is to reset password attempt
/////////////////////////////////////////////////////////////////
#include <Password.h> //http://www.arduino.cc/playground/uploads/Code/Password.zip
#include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip
int ledpin = 4;
int lockpin = 2;
Password password = Password( "123" );
const byte ROWS = 4; // Four rows
const byte COLS = 3; // columns
// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'},
};
byte rowPins[ROWS] = {9,8,7,6 };// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte colPins[COLS] = {12, 11, 10};// Connect keypad COL0, COL1 and COL2 to these Arduino pins.
// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup(){
pinMode(ledpin, OUTPUT);
pinMode(lockpin, OUTPUT);
Serial.begin(9600);
keypad.addEventListener(keypadEvent); //add an event listener for this keypad
}
void loop(){
char keys = keypad.getKey();
}
//take care of some special events
void keypadEvent(KeypadEvent eKey){
switch (keypad.getState()){
case PRESSED:
Serial.print(eKey);
switch (eKey){
case '*': checkPassword(); break;
case '#': password.reset(); break;
default: password.append(eKey);
}}}
void checkPassword(){
if (password.evaluate()){
Serial.println("Success");
digitalWrite(ledpin, HIGH);
digitalWrite(lockpin, HIGH);
delay(5000);
digitalWrite(ledpin, LOW);
digitalWrite(lockpin, LOW);
//Add code to run if it works
}else{
Serial.println("Wrong");
digitalWrite(ledpin, HIGH);
delay(500);
digitalWrite(ledpin, LOW);
delay(500);
digitalWrite(ledpin, HIGH);
delay(500);
digitalWrite(ledpin, LOW);
delay(500);
digitalWrite(ledpin, HIGH);
delay(500);
digitalWrite(ledpin, LOW);
delay(500);
digitalWrite(ledpin, HIGH);
delay(500);
digitalWrite(ledpin, LOW);
}
}
I would like to find an easier way to blink the led when the wrong code is entered.
Thanks Everyone 73s
Chip KJ4QCV