lejos.nxt.addon
Class EOPD

java.lang.Object
  extended by lejos.nxt.addon.EOPD
All Implemented Interfaces:
SensorConstants

public class EOPD
extends java.lang.Object
implements SensorConstants

Supports HiTechnics EOPD (Electro Optical Proximity Detector) sensor.
This sensor is used to detect objects and small changes in distance to a target. Unlike the lego light sensor it is not affected by other light sources.

Author:
Michael Smith

Field Summary
 
Fields inherited from interface lejos.nxt.SensorConstants
BLACK, BLANK_INDEX, BLUE, BLUE_INDEX, GREEN, GREEN_INDEX, MAX_AD_RAW, MAX_TYPE, MIN_TYPE, MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, RED, RED_INDEX, TYPE_ANGLE, TYPE_COLORBLUE, TYPE_COLORFULL, TYPE_COLORGREEN, TYPE_COLORNONE, TYPE_COLORRED, TYPE_CUSTOM, 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
EOPD(ADSensorPort port)
          By default the sensor is short range.
EOPD(ADSensorPort port, boolean longRange)
           
 
Method Summary
 int processedValue()
           
 int readRawValue()
           
 void setModeLong()
          Changes the port to long range mode.
 void setModeShort()
          Changes the sensor to short range mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOPD

public EOPD(ADSensorPort port)
By default the sensor is short range.

Parameters:
port - NXT sensor port 1-4

EOPD

public EOPD(ADSensorPort port,
            boolean longRange)
Parameters:
port - NXT sensor port 1-4.
longRange - true = long range false = short range.
Method Detail

setModeShort

public void setModeShort()
Changes the sensor to short range mode.


setModeLong

public void setModeLong()
Changes the port to long range mode.


readRawValue

public int readRawValue()
Returns:
The raw value is returned.

processedValue

public int processedValue()
Returns:
A value between 0 and 100. This mimics the HiTechnic programming block.