|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.aplu.nxt.Part
ch.aplu.nxt.Sensor
ch.aplu.nxt.TouchSensor
public class TouchSensor
Class that represents a touch sensor.
| Field Summary |
|---|
| Fields inherited from class ch.aplu.nxt.Part |
|---|
robot |
| Constructor Summary | |
|---|---|
TouchSensor()
Creates a sensor instance connected to port S1. |
|
TouchSensor(SensorPort port)
Creates a sensor instance connected to the given port. |
|
| Method Summary | |
|---|---|
void |
addTouchListener(TouchListener touchListener)
Registers the given touch listener. |
protected void |
cleanup()
|
protected void |
init()
|
protected boolean |
isActuated()
|
boolean |
isPressed()
Polls the sensor. |
protected void |
startTouchThread()
|
protected void |
stopTouchThread()
|
| Methods inherited from class ch.aplu.nxt.Sensor |
|---|
getPort, getPortId, getPortLabel, LSRead, LSWrite, readBooleanValue, readNormalizedValue, readRawValue, readScaledValue, setTypeAndMode |
| Methods inherited from class ch.aplu.nxt.Part |
|---|
setRobot |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TouchSensor(SensorPort port)
port - the port where the sensor is plugged-inpublic TouchSensor()
| Method Detail |
|---|
protected void init()
init in class Partprotected void cleanup()
cleanup in class Partpublic void addTouchListener(TouchListener touchListener)
touchListener - the TouchListener to become registered.protected void startTouchThread()
protected void stopTouchThread()
protected boolean isActuated()
public boolean isPressed()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||