High speed photogate readings and hardware interrupts (Help Needed)

Thanks for the code but I am afraid that I am none the wiser as to what you want to do. From your original description it would seem that you want to know how many shots have been fired or how many shots remain. If that is not it then can you please explain in more detail ?

I freely admit that you could write what I know about Nerf guns in very big letters on the head of a pin, so I apologise for the question if it is not relevant, but could you not just count the number of times the trigger is pressed ?