Class HiTechnicEOPD
- java.lang.Object
-
- lejos.hardware.Device
-
- lejos.hardware.sensor.BaseSensor
-
- lejos.hardware.sensor.AnalogSensor
-
- lejos.hardware.sensor.HiTechnicEOPD
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SensorConstants,SensorMode,SensorModes,SampleProvider
public class HiTechnicEOPD extends AnalogSensor implements SensorConstants
HiTechnic EOPD Sensor
The EOPD or Electro Optical Proximity Detector uses an internal light source to detect the presence of a target or determine changes in distance to a target.
See Sensor Product page See The leJOS sensor framework SeeSupported 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- Author:
- Michael Smith
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classHiTechnicEOPD.ShortDistanceMode
-
Field Summary
Fields Modifier and Type Field Description protected static longSWITCH_DELAY-
Fields inherited from class lejos.hardware.sensor.AnalogSensor
currentType, port
-
Fields inherited from class lejos.hardware.sensor.BaseSensor
currentMode, modes
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
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 Summary
Constructors Constructor Description HiTechnicEOPD(AnalogPort port)HiTechnicEOPD(Port port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SensorModegetLongDistanceMode()HiTechnic EOPD sensor, Long distance mode
Measures the relative distance to a surface.SensorModegetShortDistanceMode()HiTechnic EOPD sensor, Short distance mode
Measures the relative distance to a surface.protected voidinit()-
Methods inherited from class lejos.hardware.sensor.AnalogSensor
normalize, NXTRawIntValue, NXTRawValue, switchType
-
Methods inherited from class lejos.hardware.sensor.BaseSensor
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
-
Methods inherited from class lejos.hardware.Device
close, releaseOnClose
-
-
-
-
Field Detail
-
SWITCH_DELAY
protected static final long SWITCH_DELAY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HiTechnicEOPD
public HiTechnicEOPD(AnalogPort port)
- Parameters:
port- NXT sensor port 1-4
-
HiTechnicEOPD
public HiTechnicEOPD(Port port)
- Parameters:
port- NXT sensor port 1-4
-
-
Method Detail
-
init
protected void init()
-
getLongDistanceMode
public SensorMode getLongDistanceMode()
HiTechnic EOPD sensor, Long distance mode
Measures the relative distance to a surface.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.
-
getShortDistanceMode
public SensorMode getShortDistanceMode()
HiTechnic EOPD sensor, Short distance mode
Measures the relative distance to a surface. This mode is suited for white objects at short distance.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.
-
-