RPM pickup from Dyno

You send a square wave, not PWM. Eventually sound() may do the trick, depending on the required frequency. Or you program a timer for the right output frequency.