public class LynxI2cColorRangeSensor extends AMSColorSensorImpl implements DistanceSensor, OpticalDistanceSensor, ColorRangeSensor
LynxI2cColorRangeSensor
is both a color sensor and a distance sensor, supporting both
DistanceSensor
for calibrated readings and OpticalDistanceSensor
(which is an
historical name that could perhaps have been chosen better) for raw, uncalibrated readings.HardwareDevice.Manufacturer
AMSColorSensor.Config, AMSColorSensor.Enable, AMSColorSensor.Gain, AMSColorSensor.LEDDrive, AMSColorSensor.Parameters, AMSColorSensor.Pers, AMSColorSensor.Register, AMSColorSensor.Status, AMSColorSensor.Wait
Modifier and Type | Field and Description |
---|---|
double |
aParam
Experimentally determined constants for converting optical measurements to distance.
|
protected static double |
apiLevelMax |
protected static double |
apiLevelMin |
double |
bParam |
double |
cParam |
TAG
parameters
deviceClient, deviceClientIsOwned, isInitialized
distanceOutOfRange
AMS_COLOR_COMMAND_BIT, AMS_COLOR_COMMAND_TYPE_AUTO_INCREMENT, AMS_COLOR_COMMAND_TYPE_REPEATED_BYTE, AMS_COLOR_COMMAND_TYPE_RESERVED, AMS_COLOR_COMMAND_TYPE_SPECIAL, AMS_TCS34725_ADDRESS, AMS_TCS34725_ID, AMS_TMD37821_ADDRESS, AMS_TMD37821_ID, AMS_TMD37823_ID
Constructor and Description |
---|
LynxI2cColorRangeSensor(I2cDeviceSynchSimple deviceClient) |
Modifier and Type | Method and Description |
---|---|
protected double |
cmFromOptical(int rawOptical)
Converts a raw optical inverse-square reading into a fitted, calibrated linear reading in cm.
|
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
double |
getDistance(DistanceUnit unit)
Returns a calibrated, linear sense of distance as read by the infrared proximity
part of the sensor.
|
double |
getLightDetected()
Get the amount of light detected by the sensor, scaled and cliped to a range
which is a pragmatically useful sensitivity.
|
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
double |
getRawLightDetected()
Returns a signal whose strength is proportional to the intensity of the light measured.
|
double |
getRawLightDetectedMax()
Returns the maximum value that can be returned by
LightSensor.getRawLightDetected() . |
int |
rawOptical() |
java.lang.String |
status()
Status of this sensor, in string form
|
alpha, argb, blue, delay, disable, dumpState, enable, enableLed, getDeviceID, getI2cAddress, getNormalizedColors, green, internalInitialize, is3782, isConnectedAndEnabled, isLightOn, normalToUnsignedShort, read, read8, readEnable, readEnableAfterWrite, readUnsignedByte, readUnsignedShort, red, setGain, setI2cAddress, setIntegrationTime, setPDrive, setProximityPulseCount, testBits, testBits, testBits, testBits, updateControl, write, write8, writeEnable
doInitialize, getParameters, initialize
close, disengage, engage, getConnectionInfo, getDeviceClient, getVersion, initialize, initializeIfNecessary, onModuleStateChange, registerArmingStateCallback, resetDeviceConfigurationForOpMode
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
alpha, argb, blue, enableLed, getI2cAddress, green, red, setI2cAddress
getNormalizedColors
enableLed
close, getConnectionInfo, getVersion, resetDeviceConfigurationForOpMode
getParameters, initialize
protected static final double apiLevelMin
protected static final double apiLevelMax
public double aParam
public double bParam
public double cParam
public LynxI2cColorRangeSensor(I2cDeviceSynchSimple deviceClient)
public double getDistance(DistanceUnit unit)
getDistance
in interface DistanceSensor
unit
- the unit of distance in which the result should be returnedprotected double cmFromOptical(int rawOptical)
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
getDeviceName
in class AMSColorSensorImpl
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
getManufacturer
in class AMSColorSensorImpl
public double getLightDetected()
LightSensor
getLightDetected
in interface LightSensor
public double getRawLightDetected()
LightSensor
getRawLightDetected
in interface LightSensor
public double getRawLightDetectedMax()
LightSensor
LightSensor.getRawLightDetected()
.getRawLightDetectedMax
in interface LightSensor
LightSensor.getRawLightDetected()
public java.lang.String status()
LightSensor
status
in interface LightSensor
public int rawOptical()