@AnalogSensorType @DeviceProperties(name="@string/configTypeOpticalDistanceSensor", xmlTag="OpticalDistanceSensor", builtIn=true, description="@string/optical_distance_sensor_description") public class ModernRoboticsAnalogOpticalDistanceSensor extends java.lang.Object implements OpticalDistanceSensor, AnalogSensor
ModernRoboticsAnalogOpticalDistanceSensor supports the Modern Robotics Optical
Distance Sensor.HardwareDevice.Manufacturer| Modifier and Type | Field and Description |
|---|---|
protected static double |
apiLevelMax |
protected static double |
apiLevelMin |
| Constructor and Description |
|---|
ModernRoboticsAnalogOpticalDistanceSensor(AnalogInputController analogInputController,
int physicalPort) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes this device
|
void |
enableLed(boolean enable)
Enable the LED light
|
java.lang.String |
getConnectionInfo()
Get connection information about this device in a human readable format
|
java.lang.String |
getDeviceName()
Returns a string suitable for display to the user as to the type of device.
|
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 |
getMaxVoltage() |
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 |
getVersion()
Version
|
double |
readRawVoltage()
Returns the sensor's current value as a raw voltage level.
|
void |
resetDeviceConfigurationForOpMode()
Resets the device's configuration to that which is expected at the beginning of an OpMode.
|
java.lang.String |
status()
Status of this sensor, in string form
|
java.lang.String |
toString() |
protected static final double apiLevelMin
protected static final double apiLevelMax
public ModernRoboticsAnalogOpticalDistanceSensor(AnalogInputController analogInputController, int physicalPort)
public java.lang.String toString()
toString in class java.lang.Objectpublic double getLightDetected()
LightSensorgetLightDetected in interface LightSensorpublic double getMaxVoltage()
public double getRawLightDetected()
LightSensorgetRawLightDetected in interface LightSensorpublic double getRawLightDetectedMax()
LightSensorLightSensor.getRawLightDetected().getRawLightDetectedMax in interface LightSensorLightSensor.getRawLightDetected()public double readRawVoltage()
AnalogSensorreadRawVoltage in interface AnalogSensorpublic void enableLed(boolean enable)
LightSensorenableLed in interface LightSensorenable - true to enable; false to disablepublic java.lang.String status()
LightSensorstatus in interface LightSensorpublic HardwareDevice.Manufacturer getManufacturer()
HardwareDevicegetManufacturer in interface HardwareDevicepublic java.lang.String getDeviceName()
HardwareDevicegetDeviceName in interface HardwareDevicepublic java.lang.String getConnectionInfo()
HardwareDevicegetConnectionInfo in interface HardwareDevicepublic int getVersion()
HardwareDevicegetVersion in interface HardwareDevicepublic void resetDeviceConfigurationForOpMode()
HardwareDeviceresetDeviceConfigurationForOpMode in interface HardwareDevicepublic void close()
HardwareDeviceclose in interface HardwareDevice