Interrupt on change (interrupt when the state of a pin changes)
Again this is a snippet from another chip (16F873A) but it will give you something to start with.
Code:ON INTERRUPT GOTO MYINT INTCON = %10010000 'PORTB.0 CHANGE DISABLE MYINT: IF PORTB.0 = 1 THEN ' DO SOMETHING ELSE 'DO SOMETHING ELSE ENDIF INTCON.1 = 0 RESUME ENABLE 'THE ABOVE WILL ALSO DEBOUNCE THE SWITCH
Bookmarks