public class TouchSensor extends Sensor
Constructor and Description |
---|
TouchSensor()
Creates a sensor instance connected to port S1.
|
TouchSensor(SensorPort port)
Creates a sensor instance connected to the given port.
|
Modifier and Type | Method and Description |
---|---|
void |
addTouchListener(TouchListener touchListener)
Registers the given touch listener.
|
lejos.hardware.sensor.EV3TouchSensor |
getLejosSensor()
Returns the reference of the the underlying lejos.hardware.sensor.EV3TouchSensor.
|
int |
getValue()
Polls the sensor.
|
boolean |
isPressed()
Polls the sensor.
|
getLejosPort
public TouchSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic TouchSensor()
public void addTouchListener(TouchListener touchListener)
touchListener
- the TouchListener to become registered.public int getValue()
public boolean isPressed()
public lejos.hardware.sensor.EV3TouchSensor getLejosSensor()