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.ManufacturerAMSColorSensor.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 |
TAGparametersdeviceClient, deviceClientIsOwned, isInitializeddistanceOutOfRangeAMS_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, writeEnabledoInitialize, getParameters, initializeclose, disengage, engage, getConnectionInfo, getDeviceClient, getVersion, initialize, initializeIfNecessary, onModuleStateChange, registerArmingStateCallback, resetDeviceConfigurationForOpModeclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitalpha, argb, blue, enableLed, getI2cAddress, green, red, setI2cAddressgetNormalizedColorsenableLedclose, getConnectionInfo, getVersion, resetDeviceConfigurationForOpModegetParameters, initializeprotected 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 DistanceSensorunit - the unit of distance in which the result should be returnedprotected double cmFromOptical(int rawOptical)
public java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicegetDeviceName in class AMSColorSensorImplpublic HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicegetManufacturer in class AMSColorSensorImplpublic double getLightDetected()
LightSensorgetLightDetected in interface LightSensorpublic double getRawLightDetected()
LightSensorgetRawLightDetected in interface LightSensorpublic double getRawLightDetectedMax()
LightSensorLightSensor.getRawLightDetected().getRawLightDetectedMax in interface LightSensorLightSensor.getRawLightDetected()public java.lang.String status()
LightSensorstatus in interface LightSensorpublic int rawOptical()