Timer/PCA exercises




Bicycle velocity meter

A magnetic field sensor and a small magnet on a spoke of the 26" wheel of a bicycle are used to measure velocity. The time of a the turn around is measured with a counter incremented in every 10ms. Write a function that calculates the velocity in km/h units using two successively captured counter values.