Digital lock with code for arming and disarming