Just looking in more detail at your code, this is an issue:
attachInterrupt (0, risingISR, RISING);
It seems you have your signal connected to pin 0, one of the Serial pins. OK as you don't use Serial in this case. Still it's a pin that's best used last. Worse, the external interrupts (RISING, FALLING) are only available on pins 2 and 3. That's another problem. More details here.
As interrupt numbers and pin numbers are not related, you have to use the digitalPinToInterrupt(pin) function, and you get this:
attachInterrupt (digitalPinToInterrupt(2), risingISR, RISING);
The input signal should now be connected to pin 2.