Home Alarm System – Code

The software for this system implements three states: System Clear, Deactivated, and Alarm Triggered. The code loops while the system is active waiting for the light break sensor to be open indicating that an intruder has broken in. At this point, the code snippet below compares a passcode input by a user to a predefined passcode and acts accordingly. The LCD tells you whether or not the passcode that was entered is correct.