Contact Bounce

capture_001_13112014_195949

In real life, we always have key chattering, so we must take care of it. This is a short program to see what happens when we manipulate a paddle.

capture_002_13112014_200010

Each short line shows the key up(1)/down(0) every 500 mS. The longer lines show how many times an interrupt occurs for each manipulation, namely key up or key down. It seems that a single digitalRead() immediately after an interrupt is not very reliable.

Also note that the number of interrupts per manipulation is not always an odd number. See the last five lines. Theoretically the number must be odd because there IS a status change.

Leave a Reply

Your email address will not be published. Required fields are marked *