AWOL:
"rpm" really should be qualified "volatile", though it's probably OK with your code as it is now.
thanks for the input.
I do not really grasp the volatile. I understand that it uses different memory. but how tu use it?
do i just write in definition:
volatile int rpm = 0;
thanks.