what input pin is it using?

Oh no. You have to use timing based (Real Time) code to get this to work, even using interrupts.
The stepper moves like a glacier compared to Arduino. Loop has to finish very fast to get enough reads per second for... I forget how many rpm but it's for a car wheel.

If you read 10x as often as triggers then you will be sure to catch every one a few times in a row. That lets you be sure you don't get false positives, a good thing.

Also be real careful to debug and test this insanely much before going out on any road. If someone gets hurt there will be lawyers who will do anything to make it your fault. Facts won't matter, they are trained to steer around such trivialities as facts.