RoboJDETM v2.0

com.ridgesoft.robotics.sensors
Class DevantechSRF04

java.lang.Object
  extended by com.ridgesoft.robotics.SonarRangeFinder
      extended by com.ridgesoft.robotics.sensors.DevantechSRF04
All Implemented Interfaces:
RangeFinder

public class DevantechSRF04
extends SonarRangeFinder

Class to interface with the Devantech SRF04 ultrasonic range finder.


Constructor Summary
DevantechSRF04(PulseOutput trigger, PulseInput echoInput)
          Constructs a range finder object.
 
Method Summary
 int getEchoDelay()
          Gets the echo delay, including 100 usec blanking time.
 void ping()
          Generates a ping.
 
Methods inherited from class com.ridgesoft.robotics.SonarRangeFinder
getDistanceCm, getDistanceInches
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait
 

Constructor Detail

DevantechSRF04

public DevantechSRF04(PulseOutput trigger,
                      PulseInput echoInput)
Constructs a range finder object.

Parameters:
trigger - digital output used to trigger a sonic burst
echoInput - pulse input used to measure echo delay
Method Detail

getEchoDelay

public int getEchoDelay()
Gets the echo delay, including 100 usec blanking time.

Specified by:
getEchoDelay in class SonarRangeFinder
Returns:
delay time until the echo of the ping is heard in microseconds, compensated for blanking time, -1 if pulse not complete or no pulse

ping

public void ping()
Generates a ping.

Note: The sensor has a 10 millisecond recovery time. Therefore, this method should not be called within 10 milliseconds of completion of the previous sample.

Specified by:
ping in interface RangeFinder
Specified by:
ping in class SonarRangeFinder

RoboJDETM v2.0

Copyright (c) 2003-2009 RidgeSoft, LLC. All rights reserved.
www.ridgesoft.com