I have a PDM mic (IM69D130V01XTSA1) running with this code.
Bur this is with the radio shield plugged in. Can I run the PDM mic and the shield at the same time? I need to for a project I am running
Code:
#include <Arduino.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputPDM pdm1; //xy=364,169
AudioFilterStateVariable filter1; //xy=384.99998474121094,268.0000190734863
AudioAmplifier amp1; //xy=515,170
AudioAnalyzeFFT1024 fft1024_1; //xy=567.9999961853027,241.000018119812
AudioEffectWaveshaper waveshape1; //xy=571,289
AudioOutputI2S i2s1; //xy=742,291
AudioConnection patchCord1(pdm1, amp1);
AudioConnection patchCord2(filter1, 1, fft1024_1, 0);
AudioConnection patchCord3(filter1, 1, waveshape1, 0);
AudioConnection patchCord4(amp1, 0, filter1, 0);
AudioConnection patchCord5(waveshape1, 0, i2s1, 0);
AudioControlSGTL5000 sgtl5000_1; //xy=383,359
// GUItool: end automatically generated code
// GUItool: end automatically generated code
float WAVESHAPE_INVERT[2] = {
1.0,
-1.0
};
void setup() {
AudioMemory(50);
filter1.frequency(30); // filter out DC & extremely low frequencies
amp1.gain(8.5); // amplify sign to useful range
waveshape1.shape(WAVESHAPE_INVERT, 2);
}
void loop() {
if (fft1024_1.available()) {
// each time new FFT data is available
// print 20 bins to the Arduino Serial Monitor
Serial.print("FFT: ");
for (int i = 0; i < 20; i++) {
float n = fft1024_1.read(i);
if (n >= 0.001) {
Serial.print(n, 3);
Serial.print(" ");
} else {
Serial.print(" -- "); // don't print "0.000"
}
}
Serial.println();
}
}
Bur this is with the radio shield plugged in. Can I run the PDM mic and the shield at the same time? I need to for a project I am running