We are trying to use the HC-SR04 Ultrasonic range finder. However, it is not working. Our wiring successfully wires the two signals to separate ports. Our code is attached.
RangeFinderSubsystem.java (1.2 KB)
RangeFinderSubsystem.java (1.2 KB)
What ultrasonic rangefinder are you using?
The HC-SR04.
I believe that your rangefinder is the same design as the Daventech SRF04 model and works with WPILib as described here:
http://wpilib.screenstepslive.com/s/3120/m/7912/l/85774-measuring-robot-distance-to-a-surface-using-ultrasonic-sensors
Be careful, it has two connections:
- Echo pulse output: Causes the sensor to send an ultrasonic “ping”
- Trigger pulse input: listens for the echo to return
Be sure to connect it as described in the documentation.