| Line | |
|---|
| 1 | /* This example samples the microphone for 50 milliseconds repeatedly |
|---|
| 2 | * and returns the max sound pressure level in dB SPL |
|---|
| 3 | * https://en.wikipedia.org/wiki/Sound_pressure |
|---|
| 4 | * |
|---|
| 5 | * open the serial plotter window in the arduino IDE for a nice graph |
|---|
| 6 | * of sound pressure level over time. |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #include <Adafruit_CircuitPlayground.h> |
|---|
| 10 | |
|---|
| 11 | void setup() { |
|---|
| 12 | CircuitPlayground.begin(); |
|---|
| 13 | Serial.begin(115200); |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | void loop() { |
|---|
| 17 | Serial.println(CircuitPlayground.mic.soundPressureLevel(50)); |
|---|
| 18 | } |
|---|
Note: See
TracBrowser
for help on using the repository browser.