Hi, I am sorry to barge in but, how would you handle the short press and long press with this? I could not figure out the inc_value's purpose. I am really asking, as I am also struggling with this idea. Also, I am trying to figure out a way to handle two or three button presses. Thanks, Omer >void Interrupt(void) >{ > if(button == PRESSED) > { > if(button_time < MAX_BUTTON_TIME) > button_time++; > } > else > { > button_time = 0; > } > > if(button_time < DEBOUNCE_TIME) > inc_value = 0; > else if(button_time < SLOW_INC_TIME) > inc_value = SLOW_INC_VALUE; > else > inc_value = FAST_INC_VALUE; > >} > >You then have an automagicaly increasing value in inc_value to be used >where ever it is required in your main loop. The number of increments >is easily increased, and you have debouncing built in. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body