Home Alarm with a 3 wire 4x3 analog keypad nearly done but need some help please

jezza103:
Thank you liudr. I have had a quick look at your code. Before i even try to use it I will have a read about state machines. I will get back to you and let you know how I get on.
regards
Jeremy

You are welcome.

Add the following in setup():

  Serial.begin(9600);
  pinMode(alarm_pin,OUTPUT);
  digitalWrite(alarm_pin,LOW);