public class HiTechnicNxtLightSensor extends LegacyModulePortDeviceImpl implements LightSensor, AnalogSensor
HardwareDevice.Manufacturer
Modifier and Type | Field and Description |
---|---|
protected static double |
apiLevelMax |
protected static double |
apiLevelMin |
static byte |
LED_DIGITAL_LINE_NUMBER |
static double |
MAX_LIGHT_FRACTION |
static double |
MIN_LIGHT_FRACTION |
module, physicalPort
Constructor and Description |
---|
HiTechnicNxtLightSensor(LegacyModule legacyModule,
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()
Read the scaled light level from an NXT Light sensor and return a scaled value
NOTE: Returned values INCREASE as the light energy INCREASES Typical Scaled Light Levels: LED ON (reflective): Black = 0.1 White = 0.55 LED OFF (ambient): Dark = 0.0 Bright = 1.0 |
HardwareDevice.Manufacturer |
getManufacturer()
Returns an indication of the manufacturer of this device.
|
double |
getRawLightDetected()
Read the raw light level from an NXT Light sensor
NOTE: Returned values INCREASE as the light energy INCREASES |
double |
getRawLightDetectedMax()
Returns the maximum value that can be returned by
LightSensor.getRawLightDetected() . |
int |
getVersion()
Version
|
protected void |
moduleNowArmedOrPretending()
intended as a subclass hook
|
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() |
finishConstruction, getLegacyModule, getPort, moduleNowDisarmed, onModuleStateChange
public static final byte LED_DIGITAL_LINE_NUMBER
public static final double MIN_LIGHT_FRACTION
public static final double MAX_LIGHT_FRACTION
protected static final double apiLevelMin
protected static final double apiLevelMax
public HiTechnicNxtLightSensor(LegacyModule legacyModule, int physicalPort)
protected void moduleNowArmedOrPretending()
LegacyModulePortDeviceImpl
moduleNowArmedOrPretending
in class LegacyModulePortDeviceImpl
public java.lang.String toString()
toString
in class java.lang.Object
public double getLightDetected()
getLightDetected
in interface LightSensor
public double getRawLightDetected()
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