Package lejos.hardware.sensor
Class EV3TouchSensor
- java.lang.Object
-
- lejos.hardware.Device
-
- lejos.hardware.sensor.BaseSensor
-
- lejos.hardware.sensor.AnalogSensor
-
- lejos.hardware.sensor.EV3TouchSensor
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,SensorConstants,SensorMode,SensorModes,SampleProvider
public class EV3TouchSensor extends AnalogSensor
Lego EV3 Touch sensor
The analog EV3 Touch Sensor is a simple but exceptionally precise tool that detects when its front button is pressed or released. *
See Sensor Product page See The leJOS sensor framework SeeSupported modes Mode name Description unit(s) Getter Touch Detects when its front button is pressed Binary getTouchMode()leJOS conventions for SampleProviders- Author:
- Your name
-
-
Field Summary
-
Fields inherited from class lejos.hardware.sensor.AnalogSensor
currentType, port
-
Fields inherited from class lejos.hardware.sensor.BaseSensor
currentMode, modes
-
Fields inherited from interface lejos.hardware.sensor.SensorConstants
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 Summary
Constructors Constructor Description EV3TouchSensor(AnalogPort port)EV3TouchSensor(Port port)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SensorModegetTouchMode()Lego EV3 Touch sensor, Touch mode
Detects when its front button is pressedprotected voidinit()-
Methods inherited from class lejos.hardware.sensor.AnalogSensor
normalize, NXTRawIntValue, NXTRawValue, switchType
-
Methods inherited from class lejos.hardware.sensor.BaseSensor
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
-
Methods inherited from class lejos.hardware.Device
close, releaseOnClose
-
-
-
-
Constructor Detail
-
EV3TouchSensor
public EV3TouchSensor(AnalogPort port)
-
EV3TouchSensor
public EV3TouchSensor(Port port)
-
-
Method Detail
-
init
protected void init()
-
getTouchMode
public SensorMode getTouchMode()
Lego EV3 Touch sensor, Touch mode
Detects when its front button is pressedSize and content of the sample
The sample contains one element, a value of 0 indicates that the button is not presse, a value of 1 indicates the button is pressed.- Returns:
- A sampleProvider
See
leJOS conventions for SampleProviders
-
-