public class HiTechnicEOPD extends AnalogSensor implements SensorConstants
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Long Distance | Measures the relative distance to an object | N/A, a normalized value that represents the relative distance to an object. 0 = minimum range, 1 = maximum range. | getLongDistanceMode() |
Short Distance | Measures the relative distance to an object | N/A, a normalized value that represents the relative distance to an object. 0 = minimum range, 1 = maximum range. | getShortDistanceMode() |
leJOS conventions for
SampleProviders
Modifier and Type | Class and Description |
---|---|
class |
HiTechnicEOPD.ShortDistanceMode |
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 |
---|
HiTechnicEOPD(AnalogPort port) |
HiTechnicEOPD(Port port) |
Modifier and Type | Method and Description |
---|---|
SensorMode |
getLongDistanceMode()
HiTechnic EOPD sensor, Long distance mode
Measures the relative distance to a surface. |
SensorMode |
getShortDistanceMode()
HiTechnic EOPD sensor, Short distance mode
Measures the relative distance to a surface. |
protected void |
init() |
normalize, NXTRawIntValue, NXTRawValue, switchType
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
protected static final long SWITCH_DELAY
public HiTechnicEOPD(AnalogPort port)
port
- NXT sensor port 1-4public HiTechnicEOPD(Port port)
port
- NXT sensor port 1-4protected void init()
public SensorMode getLongDistanceMode()
Size and content of the sample
The sample contains one element containing the relative distance to a surface in the range of 0 to 1.
Where 0 corresponds to the minimum of the measurement range and 1 corresponds to the maximum of the measyurement range.
The measurement range depends on the color and reflectivity of the measured surface. The measurement is more or less linear to the distance for a given surface.
public SensorMode getShortDistanceMode()
Size and content of the sample
The sample contains one element containing the relative distance to a surface in the range of 0 to 1.
Where 0 corresponds to the minimum of the measurement range and 1 corresponds to the maximum of the measyurement range.
The measurement range depends on the color and reflectivity of the measured surface. The measurement is more or less linear to the distance for a given surface.