|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ch.aplu.nxt.Part ch.aplu.nxt.Sensor ch.aplu.nxt.SoundSensor
public class SoundSensor
Class that represents a sound sensor.
Field Summary |
---|
Fields inherited from class ch.aplu.nxt.Part |
---|
robot |
Constructor Summary | |
---|---|
SoundSensor()
Creates a sensor instance connected to port S1. |
|
SoundSensor(SensorPort port)
Creates a sensor instance connected to the given port. |
Method Summary | |
---|---|
void |
addSoundListener(SoundListener soundListener,
int triggerLevel)
Registers the given sound listener for the given trigger level. |
protected void |
cleanup()
|
int |
getValue()
Polls the sensor. |
protected void |
init()
|
protected void |
startSoundThread()
|
protected void |
stopSoundThread()
|
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 SoundSensor(SensorPort port)
port
- the port where the sensor is plugged-inpublic SoundSensor()
Method Detail |
---|
protected void init()
init
in class Part
protected void cleanup()
cleanup
in class Part
public void addSoundListener(SoundListener soundListener, int triggerLevel)
soundListener
- the SoundListener to become registered.triggerLevel
- the trigger level where the callback is triggeredprotected void startSoundThread()
protected void stopSoundThread()
public int getValue()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |