82 years old and just starting with Arduino sketches. Am trying to code for a flap door system (big flap so large dog can use it which means a human can also possibly use it to gain entry to my house). Flap will have a reed switch which when flap is in it's idle position is held by a magnet in the switch open position. Dog uses door and reed switch closes but only for up to say 2.5 seconds - in this scenario no alarm to result. If open for longer than 2.5 seconds then set an alarm pin on my Arduino Uno to sound the alarm for say 20 seconds then system resets for next event. I used pin 2 on the board as switch sensor input and pin 12 as alarm output and tried modifying the example sketch called Button that is available in the Arduino suite but I am so new at it I have failed to get the response I want.
Any help will be welcome.