@I2cDeviceType @DeviceProperties(name="@string/rev_color_sensor_v3_name", description="@string/rev_color_sensor_v3_description", xmlTag="RevColorSensorV3", compatibleControlSystems=REV_HUB, builtIn=true) public class RevColorSensorV3 extends BroadcomColorSensorImpl implements DistanceSensor, OpticalDistanceSensor, ColorRangeSensor
RevColorSensorV3
implements support for the REV Robotics Color Sensor V3.HardwareDevice.Manufacturer
BroadcomColorSensor.Gain, BroadcomColorSensor.LEDCurrent, BroadcomColorSensor.LEDPulseModulation, BroadcomColorSensor.MainControl, BroadcomColorSensor.MainStatus, BroadcomColorSensor.Parameters, BroadcomColorSensor.PSMeasurementRate, BroadcomColorSensor.PSResolution, BroadcomColorSensor.Register
Modifier and Type | Field and Description |
---|---|
protected static double |
apiLevelMax |
protected static double |
apiLevelMin |
TAG
parameters
deviceClient, deviceClientIsOwned, isInitialized
distanceOutOfRange
BROADCOM_APDS9151_ADDRESS, BROADCOM_APDS9151_ID
Constructor and Description |
---|
RevColorSensorV3(I2cDeviceSynchSimple deviceClient) |
Modifier and Type | Method and Description |
---|---|
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() . |
protected double |
inFromOptical(int rawOptical)
Converts a raw optical inverse-square reading into a fitted, calibrated linear reading in
INCHES.
|
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, isLightOn, read, read8, readMainCtrl, readUnsignedByte, readUnsignedShort, red, setGain, setI2cAddress, setLEDParameters, setPDrive, setProximityPulseCount, setPSRateAndRes, testBits, testBits, write, write8
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 RevColorSensorV3(I2cDeviceSynchSimple deviceClient)
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
getDeviceName
in class BroadcomColorSensorImpl
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
getManufacturer
in class BroadcomColorSensorImpl
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 double getDistance(DistanceUnit unit)
getDistance
in interface DistanceSensor
unit
- the unit of distance in which the result should be returnedprotected double inFromOptical(int rawOptical)
public int rawOptical()