donperryjm
Well-known member
If i change this to the mono audio design scheme, it works, sound is passed to the USB
However, using this in stereo doesn't work on the 4.1
This same code works on the 3.5
However, using this in stereo doesn't work on the 4.1
This same code works on the 3.5
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <avr/wdt.h>
#include "SerialCom.h"
#include "settings.h"
#include "RunningAverage.h"
#include "Spark.h"
#include "quickPWM.h"
// GUItool: begin automatically generated code
AudioInputAnalogStereo adcs1(A2, A3); //xy=151,366.0000047683716
AudioFilterBiquad biquad1R; //xy=399,397
AudioFilterBiquad biquad1L; //xy=406,284
AudioAmplifier amp1L; //xy=568,266
AudioAmplifier amp1R; //xy=578,386
AudioAnalyzePeak peakR; //xy=660,654
AudioOutputUSB usb2; //xy=814,349
AudioAnalyzePeak peakL; //xy=818,114
AudioConnection patchCord1(adcs1, 0, biquad1L, 0);
AudioConnection patchCord2(adcs1, 1, biquad1R, 0);
AudioConnection patchCord3(biquad1R, amp1R);
AudioConnection patchCord4(biquad1L, amp1L);
AudioConnection patchCord5(amp1L, peakL);
AudioConnection patchCord6(amp1L, 0, usb2, 0);
AudioConnection patchCord7(amp1R, peakR);
AudioConnection patchCord8(amp1R, 0, usb2, 1);
// GUItool: end automatically generated code
AudioOutputI2S2 unused_but_needed_output;
RunningAverage myRa_RPM(12);
void setup()
{
AudioMemory(12);
for (int i = 0; i < 4; i++) {
//startup light
digitalWrite(13, !digitalRead(13));
delay(100);
}
amp1L.gain(55.2); //used to be 30
amp1R.gain(85.2); //used to be 30
float filterboost = (1.0);
biquad1L.setHighpass(0, 5000, filterboost);
biquad1L.setLowpass(1, 8000, filterboost);
biquad1R.setHighpass(0, 5000, filterboost);
biquad1R.setLowpass(1, 8000, filterboost);
}
void loop()
{
return;
}