davidv Guest
|
How should I structure my code for this application? |
Posted: Sun Oct 19, 2008 12:47 am |
|
|
I'm making a lock circuit that has 4 buttons: key1, Key2, Key3 and Enter Key.
It's a 3 combination lock and each number is entered by pressing key1, key2 or key3 and then enter key to unlock (if combo is right). For example, pressing key1 3 times, key2 one time and key3 6 times means that the combo is 3,1 and 6.
Also I want to design it so that If I hold the enter key for more than 6 sec, the lock will ask for my old combination before allowing me enter a new combination.
My question is what is the best way to structure the programming code for this application? What are some other code structures beside state machine? |
|