Robin2:
I use the program in this link to detect the speed of a small motor. Note how simple the ISR code is and how there is no need for detachInterrupt()...R
Thanks for your answare. The problem is with interrupt 0(pin2). I don't know why, but it does not give me the right answare. interrupt 1 (pin 3) is good and I don't have any problem with my code.