public abstract class IrSeekerSensor extends java.lang.Object implements HardwareDevice
Determine the location of an IR source
Modifier and Type | Class and Description |
---|---|
static class |
IrSeekerSensor.IrSeekerIndividualSensor
IR Sensor attached to an IR Seeker
|
static class |
IrSeekerSensor.Mode
Enumeration of device modes
|
Modifier and Type | Field and Description |
---|---|
static int |
MAX_NEW_I2C_ADDRESS |
static int |
MIN_NEW_I2C_ADDRESS |
Constructor and Description |
---|
IrSeekerSensor() |
Modifier and Type | Method and Description |
---|---|
abstract double |
getAngle()
Estimated angle in which the signal is coming from
|
abstract int |
getI2cAddress()
Get the current I2C Address of this object.
|
abstract IrSeekerSensor.IrSeekerIndividualSensor[] |
getIndividualSensors()
Get a list of all IR sensors attached to this seeker.
|
abstract IrSeekerSensor.Mode |
getMode()
Get the device mode
|
abstract double |
getSignalDetectedThreshold()
Get the minimum threshold for a signal to be considered detected
|
abstract double |
getStrength()
IR Signal strength
|
abstract void |
setI2cAddress(int newAddress)
Set the I2C address to a new value.
|
abstract void |
setMode(IrSeekerSensor.Mode mode)
Set the device mode
|
abstract void |
setSignalDetectedThreshold(double threshold)
Set the minimum threshold for a signal to be considered detected
|
abstract boolean |
signalDetected()
Returns true if an IR signal is detected
|
static void |
throwIfModernRoboticsI2cAddressIsInvalid(int newAddress) |
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
close, getConnectionInfo, getDeviceName, getVersion
public static final int MAX_NEW_I2C_ADDRESS
public static final int MIN_NEW_I2C_ADDRESS
public abstract void setSignalDetectedThreshold(double threshold)
threshold
- minimum thresholdpublic abstract double getSignalDetectedThreshold()
public abstract void setMode(IrSeekerSensor.Mode mode)
mode
- sample ratepublic abstract IrSeekerSensor.Mode getMode()
public abstract boolean signalDetected()
public abstract double getAngle()
If the signal is estimated to be directly ahead, 0 will be returned. If the signal is to the left a negative angle will be returned. If the signal is to the right a positive angle will be returned. If no signal is detected, a 0 will be returned.
NOTE: not all sensors give an accurate angle.
public abstract double getStrength()
Detected IR signal strength, on a scale of 0.0 to 1.0, where 0 is no signal detected and 1 is max IR signal detected.
public abstract IrSeekerSensor.IrSeekerIndividualSensor[] getIndividualSensors()
public abstract void setI2cAddress(int newAddress)
public abstract int getI2cAddress()
public java.lang.String toString()
toString
in class java.lang.Object
public static void throwIfModernRoboticsI2cAddressIsInvalid(int newAddress)