Go Down

Topic: Button Sequence question (Read 1 time) previous topic - next topic

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.

PaulS

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.

0AlphaOmega

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.
For whom does the clock pulse? It pulses for you!


Go Up