dpharris@telus.net wrote: >> What is the 'bounce' time for contacts on a membrane keypad (without >> clicky >> discs) or the rubber keypads with carbon 'pills'. Very variable and user >> dependent I imagine. > > I don't know, and I suspect, as you do, they are very variable. However, > one > still needs to wait for whatever bouncing is occurring to end; whether the > method used employs a busy-wait, a timed interrupt, or the method that I > outlined. The first busy-wait wastes the cpu cycles during it, the > interrupt > method is uses up resources. The last would appear to be sufficient, and > it is > likely that it fits nicely into the (pre-existing) background loop found > in many > programs that implement a UI. Ganssle describes a method where you shift in a '1' or a '0' into a byte (or an int16, etc) and then compare the result with 0x00 or 0xFF. You can enhance it further by checking the timer before shifting a bit in, to ensure you don't sample too fast. Vitaliy -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist