Measuring car RPM is giving weird answers

Gahhhrrrlic:
Aarg: Are you suggesting that the rule I'm breaking is that I didn't declare the variables in the interrupt "volatile" ?

if (and only if) the compiler believes that in the flow of your program you are not using a variable, the compiler may optimize it away...

since the main() program calls setup() and loop() but not your ISR, that could be a problem as the optimization occurs. The compiler may believe that this variable is never used. because it cannot "see" that this function is used (as in your case, it is triggered by a hardware event).

to prevent this kind of optimization, you declare a variable volatile; the optimization will no longer affect this variable.

HOWEVER, if you are in fact using those variables in the context of your program flow, such variables may not actually be optimized out. So, your use of the variables in the context of the ISR and within functions guaranteed to be called, may have eliminated the need to protect the variables from the compiler's appetite for optimization.

You should however keep in convention and assert that those variables are protected by simply using the volatile keyword. This helps you indicate that someone else may come along and change this value (at any time).

I hope that makes sense!