public class TouchMUX extends AnalogSensor
| Modifier and Type | Field and Description |
|---|---|
static int |
ID_T1
Bit ID returned by readSensors when sensor T1 is pressed
|
static int |
ID_T2
Bit ID returned by readSensors when sensor T1 is pressed
|
static int |
ID_T3
Bit ID returned by readSensors when sensor T1 is pressed
|
static int |
NUMBER_OF_SENSORS
number of touch sensors supported by this device
|
Touch |
T1
Instance for the touch sensor connected to port T1
|
Touch |
T2
Instance for the touch sensor connected to port T2
|
Touch |
T3
Instance for the touch sensor connected to port T3
|
currentType, portcurrentMode, modesBLACK, 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 |
|---|
TouchMUX(AnalogPort port)
Create a object to provide access to a touch sensor multiplexer
|
TouchMUX(Port port)
Create a object to provide access to a touch sensor multiplexer
|
| Modifier and Type | Method and Description |
|---|---|
Touch |
getInstance(int id)
Return a Touch interface providing access to the sensor specified by the
given id.
|
int |
readSensors()
Read the touch multiplexer and return a bit mask showing which sensors
are currently pressed.
|
normalize, NXTRawIntValue, NXTRawValue, switchTypefetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModesclose, releaseOnClosepublic static final int NUMBER_OF_SENSORS
public static final int ID_T1
public static final int ID_T2
public static final int ID_T3
public final Touch T1
public final Touch T2
public final Touch T3
public TouchMUX(AnalogPort port)
port - The NXT sensor port to which the multiplexer is attachedpublic TouchMUX(Port port)
port - The NXT sensor port to which the multiplexer is attachedpublic Touch getInstance(int id)
id - a number between 0..NUMBER_OF_SENSORS-1public int readSensors()