Getting RPM by measuring non-symetric signal.

Riva:
_Thank you for the feedback. I'm not sure what you meant by "place code between code tags". I did have some code I commented out with /* & */ so it wouldn't run when debugging. Was that what you were reffering to? _ Nevermind I just figured it out (was wondering how that was done when I initially posted this). Got it now!

Questions:

  • Good idea on the flip flop idea, as deleting the need to filter out different times. As for you second point would I use attachinterrupt(0,int_ISR,RISING) to measure time between the points mentioned? instead of "timeDifference" I could put that into an long array?
  • It seems to me that this would randomly lock onto either the long time (A1-b1) OR longer time (b1-a2). Any ideas on how to only time the (b1 - a2) time. I think that would give me better resolution, especially at high rotational speeds (since the pules get closer together at the high speeds).
  • Also I am a little "fuzzy" on the need and use of the "volatile" item. Could you explain it?

jremington:
You may be right on not needing interrupts for this. I am just using it as an excuse to "play-with/learn" how to use interrupts. Once I get this working, I may try a non-interrupt approach. The input from a sensor just seemed like a natural use for an interrupt driven routine. (but then again, I am new to this Ardunio stuff)!!! I was able to get the above code to work and display the "Filled up 100 items..." string. But when I tried to disable interrupts (in the interrupt routine) to give me time to print out the results, the code locks and no further output. (never gets to the interrupts() command to re start interrupts.). Anyway thank you for taking the time to respond.