Autor Thema: Make a code lock  (Gelesen 4895 mal)

Offline Runerask

  • Newbie
  • *
  • Beiträge: 17
Make a code lock
« am: Oktober 17, 2007, 19:23:25 Nachmittag »
I need more help  :P

I'm going to make a code lock on a door to basement. and I need some help.

I going to use three pressbuttons, and every button has to be pushed as many times as the code in a correct order.

example; 4 push S2, 3 push S1 and one push S2.
Then I got two codes, one for the order of buttons and one for the code itself  ;D


How is the best way to programme it?



Thank you very much for helping  :D

Offline Philip

  • Newbie
  • *
  • Beiträge: 3
Re: Make a code lock
« Antwort #1 am: Oktober 18, 2007, 12:13:07 Nachmittag »
Start with a timer, to reset lock if no button is pressed for say five seconds. This gets you to state 1. Then use counter to count button 1 presses and use a comparator to check if number of counts == 4 or whatever value you have programmed, that gets you to state 2. Do the same for other buttons until correct code has been entered. If wrong button is pressed jump to say state 10 where system will eventually reset when no button has been pressed for 5 seconds.


Offline Mr. Spok

  • Sr. Member
  • ****
  • Beiträge: 652
Re: Make a code lock
« Antwort #2 am: Oktober 18, 2007, 12:38:10 Nachmittag »
Hello Runerask,

in the appendix is an example for a code-look.

I1 = S1
I2 = S2
I3 = S3

first press 4 push S2 then
second press 3 push to S1 then
third press 1 push to S3

then the door is open for 5 seconds (it makes T2).

You have a time-window for input from 10 seconds (it makes T1).
If you make a error (mor pushes or not the next right button) then it will reset.


Regards Jan
Für die Richtigkeit und Funktionalität der hier veröffentlichten Beispiele wird keine Gewähr übernommen.
Für Schäden, die durch Verwendung der Beispiele entstehen, wird keine Haftung übernommen.

Offline Runerask

  • Newbie
  • *
  • Beiträge: 17
Re: Make a code lock
« Antwort #3 am: Oktober 18, 2007, 22:31:28 Nachmittag »
Thank you very much  ;D

I'm just simulated your progamme and its perfect  :D


I'm going to integrated it to rest of my program this weekend  :)

Thank you very much again.