Hi Friends!! Can anybody help me with example for #int_rb and #int_timer1 interrupts for making one button with different function? (push without holding ->increment var.count, push with holding 1-2second ->clear var. count)
Thanks before
trirath
Joined: 14 Jun 2010 Posts: 20 Location: Pathunthanee Thailand
Posted: Wed Aug 25, 2010 3:44 am
Let see example and you can modify. It work fine but may not be expert code.
while(!input(PIN_B4) && (++timeout<350000)); //PRESS LONG APP 3 SECOND
beep(); //call Beep routine
if(input(PIN_B4))
{
MENU=!MENU; // Menu is int1
// Loop Menu if press not longer than 3 second
if(MENU==0){ //do something// }
if(MENU==1){ //do something//}
}
else { //Press more then 3 second do this
delay_ms(200);
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum