diff --git a/libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino b/libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino index 977a3835..1c966a38 100644 --- a/libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino +++ b/libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino @@ -12,7 +12,7 @@ // The default Circuit Playground Bluefruit pins // data pin, clock pin, power pin (-1 if not used) -PDMClass PDM(33, 34, -1); +PDMClass PDM(24, 25, -1); // buffer to read samples into, each sample is 16-bits short sampleBuffer[256]; @@ -41,13 +41,13 @@ void setup() { void loop() { // wait for samples to be read - if (samplesRead) { + PDM.IrqHandler(); + if (samplesRead) { // print samples to the serial monitor or plotter for (int i = 0; i < samplesRead; i++) { Serial.println(sampleBuffer[i]); } - // clear the read count samplesRead = 0; } @@ -62,4 +62,4 @@ void onPDMdata() { // 16-bit, 2 bytes per sample samplesRead = bytesAvailable / 2; -} +} \ No newline at end of file