public class EV3IRSensor extends BaseSensor
leJOS conventions for
SampleProviders
Modifier and Type | Class and Description |
---|---|
private class |
EV3IRSensor.DistanceMode |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
LEGO_EV3_IR |
currentMode, currentModeS, modes, SWITCH_DELAY
ADDRESS, DEVICE, DEVICE_ROOT_PATH, LEGO_PORT, LEGO_SENSOR, MODE, PATH_DEVICE
BATTERY, BATTERY_BRICKPI, BATTERY_EV3, BATTERY_PISTORMS, LEGO_UART_SENSOR, SENSOR_MODE, SENSOR_MODES
BRICKPI, EV3BRICK, PISTORMS
Constructor and Description |
---|
EV3IRSensor(java.lang.String portName) |
Modifier and Type | Method and Description |
---|---|
SensorMode |
getDistanceMode()
EV3 Infra Red sensors, Distance mode
Measures the distance to an object in front of the sensors. |
private void |
init() |
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes, switchMode, switchMode
detect, getIntegerAttribute, getPlatform, getStringAttribute, setIntegerAttribute, setStringAttribute
close, releaseOnClose
private static final java.lang.String LEGO_EV3_IR
private 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 sensors. 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 sensors 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