RoboJDETM v2.0

com.ridgesoft.robotics.sensors
Class ParallaxPing

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

public class ParallaxPing
extends SonarRangeFinder

Class to interface with the Parallax Ping))) ultrasonic range finder.


Constructor Summary
ParallaxPing(PulseInput signal)
          Constructs a ParallaxPing object.
 
Method Summary
 int getEchoDelay()
          Gets the echo delay.
 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

ParallaxPing

public ParallaxPing(PulseInput signal)
Constructs a ParallaxPing object.

Parameters:
signal - A digital input port that supports both the PulseInput and PulseOutput interfaces.
Method Detail

getEchoDelay

public int getEchoDelay()
Gets the echo delay.

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

ping

public void ping()
Generates a ping.

Note: At its longest range, the sensor will take approximately 20 milliseconds to take a range measurement. Therefore, this method should not be called more frequently than every 25 milliseconds or so.

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