Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
ehh.. I suppose that is fairly simple
just get the input, and compare with the password
if it is equal, then unlock (through some external circuit), otherwise, dont bother it, and remain lock
This can be done easily even using assembly
The best choice is probably to design a state machine for your pushbuttons and states. You would usually have a state for button pressed and then button released and with four inputs, it becomes fairly easy to design an arbitrary length password. Each correct button press just moves you to the next state, the last state being "unlock" or whatever. Each incorrect press moves you to either an error indicator state or back to the start state. You debounce the switches in software and it becomes fairly simple.