www.kevin.org/frc. Check the encoder code...a gear-tooth sensor really isn't much different, aside from how it keeps track of direction.
Keep us posted on how those gear-tooth sensors work. We've been able to use them in the past to get a good reading of raw speed, but direction is another beast altogether. Measuring the pulse width seems difficult given the overhead of interrupt calls and other factors.