Hi
need to do i software debounce
have a 16f1509, and input at timer0.
found this on the net.
Can someone explain how this Works, and how to implement it.
i will setup an interrupt routine, when a switch is pressed at pin to timer0.
but then what NeXT,
when key is pressed it shold just add 1 to a number,, that part i know how.
need to do i software debounce
have a 16f1509, and input at timer0.
found this on the net.
Rich (BB code):
// Service routine called by a timer interrupt
bool_t DebounceSwitch2()
{
static uint16_t State = 0; // Current debounce status
State=(State<<1) | !RawKeyPressed() | 0xe000;
if(State==0xf000)return TRUE;
return FALSE;
}
i will setup an interrupt routine, when a switch is pressed at pin to timer0.
but then what NeXT,
when key is pressed it shold just add 1 to a number,, that part i know how.