public class NXTTouchSensor extends AnalogSensor implements SensorConstants
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
Touch | Detects a press of the button | boolean | getTouchMode() |
See Mindstorms NXT HDK/SDK
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
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 |
---|
NXTTouchSensor(AnalogPort port)
Create a touch sensor object attached to the specified open port.
|
NXTTouchSensor(Port port)
Create an NXT touch sensor object attached to the specified port.
|
Modifier and Type | Method and Description |
---|---|
SensorMode |
getTouchMode()
get a sample provider that returns an indication of the button being up(0) or down(1)
|
protected void |
init() |
normalize, NXTRawIntValue, NXTRawValue, switchType
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
public NXTTouchSensor(AnalogPort port)
port
- an open Analog portpublic NXTTouchSensor(Port port)
port
- the port that has the sensor attachedprotected void init()
public SensorMode getTouchMode()