source: trunk/Arduino/libraries/Adafruit_Circuit_Playground/examples/Microphone_Demos/soundPressureLevel/soundPressureLevel.ino

Last change on this file was 3, checked in by markus, 7 years ago

Setup project structure

File size: 480 bytes
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
11void setup() {
12  CircuitPlayground.begin();
13  Serial.begin(115200);
14}
15
16void loop() {
17  Serial.println(CircuitPlayground.mic.soundPressureLevel(50));
18}
Note: See TracBrowser for help on using the repository browser.