A simple door lock that is demonstrated using cardboard as a door and hinge.

How it works:

1. Type a password
2. If password correct, call OpenDoor() function in code. (or press the physical button)
3. Motor will rotate 90 degrees
4. For locking, press a button of choice in keyboard (or press the physical button again)
5. CloseDoor() will be called.
6. Motor will rotate -90 degrees

Photos / Video: