*Partial* reply for now. Work beckons! Donald Riedinger wrote: > Are we all agreed that you need to sample a mechanical switch for at > least 20 ms to see if it has actually settled to a different state > after bouncing? No. In *this* application, debouncing is neither necessary nor in any way desirable. If any switch closure is detected at any time, it *has* been pressed; it was not an accident. My thesis was that if it is impossible to be sure whether two switches were pressed at once and/ or which was first, then it is probably "fairer" to simply accept a delay *of the order of* 50 µs in the determination (this being well within the mechanical variances of the switch design, let alone the human interface) and use a tie-breaking algorithm that is *scrupulously* equitable. My suggestions as made, follow accordingly, and I think already cover most of your comments. -- Cheers, Paul B.