I'm running across a problem.
I have a 10 millisecond poll cycle on the device. This means in a given second, I will check the state of the sensor 100 times.
This might not be enough. I'm finding that no matter how hard I pedal, I can't get above ~250rpm. It could very well mean that I'm just not going that fast, but even when I have the friction off the wheel, I'm not able to make it go any quicker. I think this is because in 100 polls a second, there are only so many "up-down" states it can accurately measure before the detection and calculation for one bleed into the detection and calculation for another.
I may have to rewrite my software to use an Interrupt Service Routine to maintain state. That is, rely on a hardware mechanism that can detect signals asynchronously from the normal line of processing, and even halt normal processing to detect a signal properly.