public class NXTSoundSensor extends AnalogSensor implements SensorConstants
Supported modes | |||
---|---|---|---|
Mode name | Description | unit(s) | Getter |
dBA | Measures sound level adjusted to the sensitivity of the human ear | N/A, normalized | getDBAMode() |
dB | Measures sound level | N/A, normalized | getDBMode() |
See Mindstorms NXT HDK/SDK
See The
leJOS sensor framework
See leJOS conventions for
SampleProviders
Modifier and Type | Class and Description |
---|---|
class |
NXTSoundSensor.DBMode |
Modifier and Type | Field and Description |
---|---|
protected static long |
SWITCH_DELAY |
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 |
---|
NXTSoundSensor(AnalogPort port)
Create a sound sensor.
|
NXTSoundSensor(Port port)
Create a sound sensor.
|
Modifier and Type | Method and Description |
---|---|
SampleProvider |
getDBAMode()
get a sample provider the returns the sound level adjusted to how a human ear would experience it
|
SampleProvider |
getDBMode()
get a sample provider the returns the sound level
|
normalize, NXTRawIntValue, NXTRawValue, switchType
fetchSample, getAvailableModes, getCurrentMode, getMode, getMode, getModeCount, getName, sampleSize, setCurrentMode, setCurrentMode, setModes
close, releaseOnClose
protected static final long SWITCH_DELAY
public NXTSoundSensor(Port port)
port
- the sensor port to usepublic NXTSoundSensor(AnalogPort port)
port
- the sensor port to usepublic SampleProvider getDBMode()
public SampleProvider getDBAMode()