|
Re: 60 / getPeriod() returns 3,000,000
You definitely don't have the Hall sensor oriented correctly. The "flat" part of the sensor should be perpendicular to the magnet. If you don't bend anything, then the correct orientation is with your mounting board parallel to the face your magnets are mounted on. Preferably with all those components on the side facing the wheel.
Or, you can bend the Hall sensor backwards, towards the back of the mounting board, away from the side all the components are mounted from.
(30 seconds later) EDIT: Also, why not put something in your GetRate function that tosses out obviously incorrect values like a period less than 0.0001 seconds or something?
__________________
The difficult we do today; the impossible we do tomorrow. Miracles by appointment only.
Lone Star Regional Troubleshooter
|