Skip to content

Commit 2c5d069

Browse files
committed
fix demo to work with CPB
1 parent b9d586b commit 2c5d069

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libraries/PDM/examples/PDMSerialPlotter/PDMSerialPlotter.ino

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
// The default Circuit Playground Bluefruit pins
1414
// data pin, clock pin, power pin (-1 if not used)
15-
PDMClass PDM(33, 34, -1);
15+
PDMClass PDM(24, 25, -1);
1616

1717
// buffer to read samples into, each sample is 16-bits
1818
short sampleBuffer[256];
@@ -41,13 +41,13 @@ void setup() {
4141

4242
void loop() {
4343
// wait for samples to be read
44-
if (samplesRead) {
44+
PDM.IrqHandler();
4545

46+
if (samplesRead) {
4647
// print samples to the serial monitor or plotter
4748
for (int i = 0; i < samplesRead; i++) {
4849
Serial.println(sampleBuffer[i]);
4950
}
50-
5151
// clear the read count
5252
samplesRead = 0;
5353
}
@@ -62,4 +62,4 @@ void onPDMdata() {
6262

6363
// 16-bit, 2 bytes per sample
6464
samplesRead = bytesAvailable / 2;
65-
}
65+
}

0 commit comments

Comments
 (0)