On the right you can see my finished lock program. It is not perfect by any means, but it does work. If you load up Exercise 7.5 and run it you will find that you can enter the master password (a rather stupid 1234) and then set an open code. Once you have done this you can enter the open code and the lock will trigger. Then you can turn off the power and restart the lock. You should find that the lock value has been remembered and will fire the lock for you.

I have left the exercise of allowing the change of the master password as one for you to work on. It is not that difficult.

I have adopted a very "minimalist" approach to the user interface. The decimal points are the only parts of the LED 7 segment displays I actually use in the finished system (although I did use them while I was debugging the code). If you were making a production version of the lock you could easily modify the code so that only switches and LEDs were used for the user interface.