Measuring Pulse Width

Trying to get a MaxBotix sonar going. We’re currently measuring the analog output, which works, but has a pile of (low) spikes in the output.

Want to investigate using the pulse width; looking at the Counter class. Trying to figure out something: does getPeriod() give us the time between two successive up-edges, or between an up-edge and a down-edge? how does setSemiPeriodMode affect this? (the docs indicate that specify highSemiPeriod true means to count up on both rising and failing, so does setting highSemiPeriod mean that it only counts on the rising, but indicates the period between the last rise and the last fall?)

http://wpilib.screenstepslive.com/s/3120/m/7912/l/85635-using-counters seems more clear then the javadocs, although I haven’t tried it.

yeah, one of my students just caught that (his mentor should have). Will run experiment tonight and see what happens…

Can always fall back to the 9600 baud TX line :slight_smile:

Please post on how well this works for you. I had another report that the analog output line on that sensor was noisy.

Thanks
Brad

will report in when done; hopefully will have something tonight or tomorrow; if not by then, it will be the week of the 27th…