@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.Object
public double getLightDetected()
LightSensor
getLightDetected
in interface LightSensor
public double getMaxVoltage()
public double getRawLightDetected()
LightSensor
getRawLightDetected
in interface LightSensor
public double getRawLightDetectedMax()
LightSensor
LightSensor.getRawLightDetected()
.getRawLightDetectedMax
in interface LightSensor
LightSensor.getRawLightDetected()
public double readRawVoltage()
AnalogSensor
readRawVoltage
in interface AnalogSensor
public void enableLed(boolean enable)
LightSensor
enableLed
in interface LightSensor
enable
- true to enable; false to disablepublic java.lang.String status()
LightSensor
status
in interface LightSensor
public HardwareDevice.Manufacturer getManufacturer()
HardwareDevice
getManufacturer
in interface HardwareDevice
public java.lang.String getDeviceName()
HardwareDevice
getDeviceName
in interface HardwareDevice
public java.lang.String getConnectionInfo()
HardwareDevice
getConnectionInfo
in interface HardwareDevice
public int getVersion()
HardwareDevice
getVersion
in interface HardwareDevice
public void resetDeviceConfigurationForOpMode()
HardwareDevice
resetDeviceConfigurationForOpMode
in interface HardwareDevice
public void close()
HardwareDevice
close
in interface HardwareDevice