public class LightDetectorAdaptor
extends java.lang.Object
Constructor and Description |
---|
LightDetectorAdaptor(SampleProvider sensor)
allocates a LightSensorAdaptor ; sets mode to Ambient Accepts as
a parameter one of EV3ColorSensor, NXTColorSensor, or
NXTLightSensor
|
Modifier and Type | Method and Description |
---|---|
float |
getHigh() |
float |
getLightValue()
returns the raw light value using whatever mode has been set.
|
float |
getLow() |
java.lang.String |
getMode() |
float |
getNormalizedLightValue()
call setHigh() and setLow() before using this method.
|
void |
setHigh(float highValue)
set the value that will return 1.0 from getNormalizedLightValue()
|
void |
setLow(float lowValue)
set the value that will return 0.0 from getNormalizedLightValue()
|
void |
setReflected(boolean useReflected) |
public LightDetectorAdaptor(SampleProvider sensor)
public void setReflected(boolean useReflected)
useReflected
- if true, reflected mode will be used; otherwise the ambient
mode will be used;public java.lang.String getMode()
public float getLightValue()
public float getNormalizedLightValue()
public void setHigh(float highValue)
highValue
- public float getHigh()
public void setLow(float lowValue)
lowValue
- public float getLow()