public class EV3IRSensor extends BaseSensor
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Distance | Measures the distance to an object in front of the sensor | Undefined | getDistanceMode() |
Seek | Locates up to four beacons | Undefined, undefined | #getSeekMode() |
EV3 Infra Red sensor
The sensor can be used as a receiver for up to four Lego Ev3 IR remote controls using the #getRemoteCommand
and #getRemoteCommands
methods.
See Sensor Product page
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
Modifier and Type | Class and Description |
---|---|
private class |
EV3IRSensor.DistanceMode |
Modifier and Type | Field and Description |
---|---|
protected static int |
SWITCH_DELAY |
currentMode, currentModeS, modes
PATH_DEVICE
Constructor and Description |
---|
EV3IRSensor(java.lang.String sensorPort) |
Modifier and Type | Method and Description |
---|---|
SensorMode |
getDistanceMode()
EV3 Infra Red sensor, Distance mode
Measures the distance to an object in front of the sensor. |
protected void |
init() |
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes, switchMode, switchMode
connect, getIntegerAttribute, getStringAttribute, setIntegerAttribute, setStringAttribute
getElements, readFloat, readInteger, readString, writeInteger, writeString
close, releaseOnClose
protected static final int SWITCH_DELAY
protected void init()
public SensorMode getDistanceMode()
Size and content of the sample
The sample contains one element giving the distance to an object in front of the sensor. The distance provided is very roughly equivalent to meters
but needs conversion to give better distance. See product page for details.
The effective range of the sensor in Distance mode is about 5 to 50 centimeters. Outside this range a zero is returned
for low values and positive infinity for high values.
leJOS conventions for
SampleProviders
See Sensor Product page