Hi, If your write the debounce code to work out in which direction the key is going, i.e. key_down or key_up, Then when a key_down is received start a timer and if after a preset time a key_up has not cancelled it then do a key_held operation. I have some C code for a non-PIC micro if you are interested. Regards Peter Mcalpine petermca@ozemail.com.au - www.ozemail.com.au/~petermca mcalpine@gme.net.au - www.gme.net.au www.wrx.org.au ----- Original Message ----- From: Bob Wake & RenŽe McMeeken To: Sent: Thursday, 8 July 1999 3:57 Subject: Single switch, two functions > Any idea where to start writing code to enable a single switch to > perform two functions? I've seen switches that do one thing if pressed > briefly and another if held down for 1 sec. or more. > Can this be achieved only with a timer interrupt, or is there a better > way?