Do not output to Serial inside an interrupt handler. Serial IO requires use of interrupts, which are blocked while a handler is running.
The pattern to use is:
volatile boolean something_just_happened = false;
volatile int some_important_number;
void interruptHandler() {
some_important_number ++;
something_just_happened = true;
}
void loop() {
// check the status of the interrupt stuff
// the *only* thing that happens in this section of code is that we
// retreive the values that the interrupt handler updates
// and reset them as needed
noInterrupts();
int important_number_copy;
boolean something_just_happened_copy = something_just_happened;
if(something_just_happened) {
important_number_copy = some_important_number;
some_important_number = 0; // reset the count
something_just_happened = false; // reset the flag
}
interrupts();
// end of the nointerrupts block. Now we examine the data that we just retrieved
// and potentially do something with it
if(something_just_happened_copy) {
Serial.print("There were ");
Serial.print(important_number_copy);
Serial.println(" ticks");
}
}