OpenSound
Initializes the NXT sound sensor, sets correct sensor mode
Contents
Syntax
OpenSound(port, mode)
OpenSound(port, mode, handle)
Description
OpenSound(port, mode) initializes the input mode of NXT sound sensor specified by the sensor port and the sound mode. The value port can be addressed by the symbolic constants SENSOR_1 , SENSOR_2, SENSOR_3 and SENSOR_4 analog to the labeling on the NXT Brick. The mode represents one of two modes 'DB' (dB measurement) and 'DBA' (dBA measurement)
The last optional argument can be a valid NXT handle. If none is specified, the default handle will be used (call COM_SetDefaultNXT to set one).
For more complex settings the function NXT_SetInputMode can be used.
Examples
OpenSound(SENSOR_1, 'DB');
sound = GetSound(SENSOR_1);
CloseSensor(SENSOR_1);
See also
NXT_SetInputMode, GetSound, CloseSensor, SENSOR_1, SENSOR_2, SENSOR_3, SENSOR_4,
Signature
- Author: Linus Atorf, Alexander Behrens (see AUTHORS)
- Date: 2010/09/14
- Copyright: 2007-2010, RWTH Aachen University