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, onModuleStateChangepublic 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()
LegacyModulePortDeviceImplmoduleNowArmedOrPretending in class LegacyModulePortDeviceImplpublic java.lang.String toString()
toString in class java.lang.Objectpublic double getLightDetected()
getLightDetected in interface LightSensorpublic double getRawLightDetected()
getRawLightDetected 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