Timing
NamNori
Posts: 4
I'm attempting to time how long it takes for an airflow sensor to measure a burst of airflow. I've been trying to use the spin self-timing techniques noted in other postings and other resources:
the value I receive in the serial terminal is something like 244956324. I should be getting something on the order of 2 seconds (give or take). I'm not sure how to either convert or interpret this value as seconds (or better yet, milliseconds). Can somebody suggest where I might be going wrong?
thanks
marc
elapsed := -cnt repeat until <my sensor condition to stop is met> read sensor waitcnt(clkfreq + cnt) elapsed += cnt - 544 term.dec(elapsed)
the value I receive in the serial terminal is something like 244956324. I should be getting something on the order of 2 seconds (give or take). I'm not sure how to either convert or interpret this value as seconds (or better yet, milliseconds). Can somebody suggest where I might be going wrong?
thanks
marc
Comments
For finer resolution, you may want to consider checking the sensor condition more frequently, e.g. :
This will present the elapsed time in milliseconds.
-Phil
-Phil