Arduino Interrupt pins problem

you should declare your numOfRotations as ' volatile unsigned int ' as it appears in both main thread and the ISR routine

you can google what 'volatile ' means