public class SumoEyesSensor extends AnalogSensor implements SensorConstants
Modifier and Type | Field and Description |
---|---|
static int |
CENTER
The Constant CENTER (2).
|
static int |
LEFT
The Constant LEFT (1).
|
static int |
NO_DETECTION
The Constant NO_DETECTION (0).
|
static int |
RIGHT
The Constant RIGHT (3).
|
protected static long |
SWITCH_DELAY |
currentType, port
currentMode, modes
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 and Description |
---|
SumoEyesSensor(AnalogPort port)
Default constructor.
|
SumoEyesSensor(Port port)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
int |
getObstacle()
Returns the detected zone (NO_DETECTION (0) , RIGHT (1), CENTER (2), LEFT (3))
|
int |
getValue()
Gets the raw value of the sensor.
|
boolean |
isLongRange()
Returns the current range of the sensor.
|
void |
setLongRange(boolean longRange)
Enables long range of the sensor.
|
normalize, NXTRawIntValue, NXTRawValue, switchType
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
protected static final long SWITCH_DELAY
public static final int NO_DETECTION
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public SumoEyesSensor(AnalogPort port)
port
- the sensor portpublic SumoEyesSensor(Port port)
port
- the sensor portpublic int getValue()
public int getObstacle()
public void setLongRange(boolean longRange)
longRange
- if true, enables long range, if false enables short rangepublic boolean isLongRange()