Hall Effect Speed and Distance Sensor Code

Count the number of times the reed switch closes. When you want to output distance, multiply this count by the wheel circumference.