Sound Pressure Sensor
Last updated
Was this helpful?
Last updated
Was this helpful?
Working with a sensor works as described in the general article on . In this article, we assume you have successfully initialized the devices with the , and you stored all connected devices on a global variable devices
. We also declared a global variable called sound
.
Next, we need to know the device identifier, which 290:
Once we have a reference to the sensor, we can register a callback function:
Of course, we have to actually define the function:
Instead of just one single value, the sensor delivers four different values:
Sound level in decibel
Spectrum length
Spectrum chunk offset
Spectrum chunk data
We can access the array of value via the val
object: