Pages: 1 [2]   Go Down
Author Topic: Button Sequence question  (Read 1556 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not familiar with edge detection, do you mean just a state change detection?  If I used that, I would still need a slight delay on it, right?  I appreciate all the help, I'm an artist not an engineer, sometimes it's like reading chinese!  F.Y.I., the end goal is to build a box with a lid that looks like a Nintendo controller, and the box can only be opened by entering the Konami code, should be pretty awesome.
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 634
Posts: 50245
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Not familiar with edge detection, do you mean just a state change detection?
Yes.

Quote
If I used that, I would still need a slight delay on it, right?
Maybe. Maybe not. It depends on what you do after you detect a switch press.

Quote
I appreciate all the help, I'm an artist not an engineer, sometimes it's like reading chinese!  F.Y.I., the end goal is to build a box with a lid that looks like a Nintendo controller, and the box can only be opened by entering the Konami code, should be pretty awesome.
You probably want a small delay, then. About 10 milliseconds.
Logged

Offline Offline
Full Member
***
Karma: 5
Posts: 113
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Edge detection is close to what it sounds like - it's looking for the "edge" of a change. The change may be high to low, or low to high.

Basically, if the current state is Low, we are looking for a High, and vis versa.

In your case, for a single button, assuming a button press will drive the port High, and you do not want a repeat key function

Wait for a change to High, you can then pause for a few mS, to allow your button to settle (all electrical contacts tend to bounce. For high speed electronics, this bounce appears very slow and can look like several open/close events, so we wait for a small amount of time for the bounce to stop)
You then look at the port for a change to zero to occur (finger off), no need to denounce if you are off to do something else.
We now have a full button press.
Logged

For whom does the clock pulse? It pulses for you!

Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Awesome, thanks a ton
Logged

Pages: 1 [2]   Go Up
Jump to: