|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lejos.nxt.addon.TouchMUX
public class TouchMUX
Interface for the Mindsensors Touch Multiplexer. This device allows up to three touch sensors to be attached to a single NXT sensor port.
Field Summary | |
---|---|
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 |
Constructor Summary | |
---|---|
TouchMUX(ADSensorPort port)
Create a object to provide access to a touch sensor multiplexer |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public 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
Constructor Detail |
---|
public TouchMUX(ADSensorPort port)
port
- The NXT sensor port to which the multiplexer is attachedMethod Detail |
---|
public Touch getInstance(int id)
id
- a number between 0..NUMBER_OF_SENSORS
-1
public int readSensors()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |