|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ridgesoft.robotics.SonarRangeFinder
com.ridgesoft.robotics.sensors.DevantechSRF08
public class DevantechSRF08
Class to interface with the Devantech SRF08 ultrasonic range finder.
Constructor Summary | |
---|---|
DevantechSRF08(I2CMaster i2cMaster)
Constructs a DevantechSRF08 object using the default device address, 0xe0. |
|
DevantechSRF08(I2CMaster i2cMaster,
int deviceAddress)
Constructs a DevantechSRF08 object. |
Method Summary | |
---|---|
int[] |
getEchoData()
Gets the echo data array from the SRF08. |
int |
getEchoDelay()
Gets the echo delay. |
int |
getSoftwareRevision()
Gets the software revsion of the device's software. |
void |
ping()
Generates a ping requesting ranging results in microseconds. |
void |
rangeCentimeters(boolean annMode)
Generates a ping requesting ranging results in inches. |
void |
rangeInches(boolean annMode)
Generates a ping requesting ranging results in inches. |
void |
rangeMicroseconds(boolean annMode)
Generates a ping requesting ranging results in microseconds. |
int |
readLightSensor()
Reads the light sensor on the SRF08. |
static void |
setDeviceAddress(I2CMaster i2cMaster,
int initialAddress,
int desiredAddress)
Changes the I2C device address of the SRF08. |
void |
setGainRegister(int gain)
Sets the gain register. |
void |
setRangeRegister(int range)
Sets the range register. |
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 |
---|
public DevantechSRF08(I2CMaster i2cMaster)
i2cMaster
- I2C object for the bus the range finder connects topublic DevantechSRF08(I2CMaster i2cMaster, int deviceAddress)
i2cMaster
- I2C object for the bus the range finder connects todeviceAddress
- I2C device address of the range finderMethod Detail |
---|
public int[] getEchoData() throws IOException
Invocation of to this method must be preceeded by a call to rangeInches, rangeCentimeters, rangeMicroseconds or ping, followed by a delay while the ranging operation compeletes (65 ms, unless the range register has been set).
IOException
public int getEchoDelay()
This method and the other methods of the SonarRangeFinder class should only be used in conjunction with the ping method. The result returned by this method will be incorrect if rangeInches or rangeCentimeters is used.
getEchoDelay
in class SonarRangeFinder
public int getSoftwareRevision() throws IOException
IOException
public void ping()
ping
in interface RangeFinder
ping
in class SonarRangeFinder
public void rangeCentimeters(boolean annMode) throws IOException
Note: Do not use this method if you will be reading the range with the methods getEchoDelay, getDistanceInches or getDistanceCm. Use the ping method instead.
annMode
- true if Artificial Neural Network mode should be used
IOException
public void rangeInches(boolean annMode) throws IOException
Note: Do not use this method if you will be reading the range with the methods getEchoDelay, getDistanceInches or getDistanceCm. Use the ping method instead.
annMode
- true if Artificial Neural Network mode should be used
IOException
public void rangeMicroseconds(boolean annMode) throws IOException
Note: Do not use this method if you will be reading the range with the methods getEchoDelay, getDistanceInches or getDistanceCm. Use the ping method instead.
annMode
- true if Artificial Neural Network mode should be used
IOException
public int readLightSensor()
public static void setDeviceAddress(I2CMaster i2cMaster, int initialAddress, int desiredAddress) throws IOException
This is used to change the address so multiple SRF08s can be used on the same I2C bus. Only one SRF08 should be connected to the bus when this method is called. See the technical reference documentation for more information.
i2cMaster
- reference to the I2C businitialAddress
- inital I2C device address of the SRF08 (factory default: 0xe0)desiredAddress
- desired I2C address (see technical documentation)
IOException
public void setGainRegister(int gain) throws IOException
See the technical reference documentation for more information.
IOException
public void setRangeRegister(int range) throws IOException
See the technical reference documentation for more information.
IOException
|
RoboJDETM v2.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |