SoundSensor describes a sound sensor. A SoundSensor instance contains the following attributes:
Table A.3. Sound sensor's attributes:
| Name | Description |
|---|---|
| val | The sound level measured (from 0 to 1). |
| mode | "DB" is decibel or "DBA" is decibel audible (measures only in the audible frequencies range). |
| port | The port where the servo is plugged. It can be 1, 2, 3 or 4. You can change the value while the server is running. Beware, if you change the port, that will free the old port (so you will be able to create another device on it) and will busy the new one (so you won't be able to create another device on it). |
| init(port_, mode_) | The UObject constructor.
Example: decibel = new SoundSensor(1, "DB"); |