public class DexterLaserSensor extends AnalogSensor implements SensorConstants
The code for this sensor has not been tested. Please report test results to the leJOS forum.
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Ambient | Measures light level with the laser off | N/A | getAmbientMode() |
Laser | Measures light level with the laser on | N/A | getLaserMode() |
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
Modifier and Type | Field and Description |
---|---|
protected static long |
SWITCH_DELAY |
currentType, port
currentMode, modes
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, BROWN, GREEN, GREEN_INDEX, MAX_TYPE, MIN_TYPE, MODE_RAW, NXT_ADC_RES, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, TYPE_HIGHSPEED, TYPE_HIGHSPEED_9V, TYPE_HISPEED, TYPE_LIGHT_ACTIVE, TYPE_LIGHT_INACTIVE, TYPE_LOWSPEED, TYPE_LOWSPEED_9V, TYPE_NO_SENSOR, TYPE_REFLECTION, TYPE_SOUND_DB, TYPE_SOUND_DBA, TYPE_SWITCH, TYPE_TEMPERATURE, WHITE, YELLOW
Constructor and Description |
---|
DexterLaserSensor(AnalogPort port)
Create a laser sensor object attached to the specified port, and sets the laser on or off.
|
DexterLaserSensor(Port port)
Create a laser sensor object attached to the specified port, and sets the laser on or off.
|
Modifier and Type | Method and Description |
---|---|
SensorMode |
getAmbientMode()
Dexter laser sensor, Ambient mode
Measures light level with the laser off |
SensorMode |
getLaserMode()
Dexter laser sensor, Laser mode
Measures light level with the laser on |
protected void |
init() |
void |
setLaser(boolean laserState) |
normalize, NXTRawIntValue, NXTRawValue, switchType
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
protected static final long SWITCH_DELAY
public DexterLaserSensor(AnalogPort port)
port
- an already open analog portpublic DexterLaserSensor(Port port)
port
- port, e.g. Port.S1protected void init()
public void setLaser(boolean laserState)
public SensorMode getAmbientMode()
Size and content of the sample
The sample contains one elements representing normalised (range 0-1) light level.
leJOS conventions for
SampleProviders
public SensorMode getLaserMode()
Size and content of the sample
The sample contains one elements representing normalised (range 0-1) light level.
leJOS conventions for
SampleProviders