Design a digital lock that has a 3 number combination. The lock should operate as follows:
- The user enters the first number (on a keypad) and throws a switch
- The user then enters a second number and throws the switch again
- The user enters the third number and throws the switch
- If all three numbers are correct, the lock is unlocked, otherwise, the lock remains
locked.
You should implement this in tkgate. Your implementation should have one switch for input
and one dipswitch for numeric input. You should have an led to indicate that the lock
is locked (light - unlocked, dim - locked).
You should store the combination within the circuit, perhaps in a switch. I used a register
to store the "state" of the lock. Each time a correct number was entered the state was
changed, and if an incorrect number was entered, the state was reset.