All you really have to do is enable the interrupt on port 1, make sure your sensor is plugged into digital I/O 1, and add 1 to a counter in the interrupt handler in "User_Routines_Fast.c"
Although to access it a quick function to disable the interrupt and return the variable's should also be used and the variable should be volatile type.
If you understood that thats good
I will edit this post with a link to a good white paper that gives an in-depth description of the interrupts. They are actually fairly easy
Here it is:
http://www.chiefdelphi.com/media/papers/1483