lejos.nxt.addon
Class EOPD

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

public class EOPD
extends 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

WARNING: THIS CLASS IS SHARED BETWEEN THE classes AND pccomms PROJECTS. DO NOT EDIT THE VERSION IN pccomms AS IT WILL BE OVERWRITTEN WHEN THE PROJECT IS BUILT.

Field Summary
 
Fields inherited from interface lejos.nxt.SensorConstants
MODE_ANGLESTEP, MODE_BOOLEAN, MODE_CELSIUS, MODE_FARENHEIT, MODE_PCTFULLSCALE, MODE_PERIODCOUNTER, MODE_RAW, MODE_TRANSITIONCNT, TYPE_ANGLE, TYPE_CUSTOM, 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
 
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.