Log in

View Full Version : Digital IO in C++


EricGoodchild
15-01-2009, 10:53
Hey does anyone know if there is a class for measuring pulse width in the WinLib library?

byteit101
15-01-2009, 15:25
Hey does anyone know if there is a class for measuring pulse width in the WinLib library?
You mean WPILib?
Pulse width of?

BradAMiller
15-01-2009, 17:49
I'm not sure what you're application is, but you can measure pulse widths using the Counter objects in semi-period mode. That is exactly what the ultrasonic sensors do and you can look at the Ultrasonic class source code as an example.

There is one problem though - there is currently a bug in the FPGA that will prevent accurate results, but it will be fixed in the next update.

biojae
15-01-2009, 23:05
Our application is to find the angle of a PWM compass that automatically pulses in. What we were wondering is if there was a way to get the interrupt easily to get the pulse width length.