Hi guys, sorry about not posting code originally, had to pare down the code as much as possible, as this project is for my work and I couldn't just post the whole sketch as it was. Below is the part of the code relating to the issue I'm having.
Code:
//Teensy 3.2, Teensyduino 1.36, Arduino 1.6.12
//USB Type: Audio
//96 MHz optimize speed (overclock)
//Libraries
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <TimeLib.h>
//BC127 I/O
#define play_pause 4
#define streaming 5
//BC127 I2S Pins
#define bt_clk 9
#define bt_out 13
#define bt_sync 23
//VREG pin
#define vreg 15
//LEDs
#define blue_led 20
//SparkFun Navigation Switch
#define steady_state 18
#define activate 19
//Switch activation/verification
int switch_state;
//Switch press debounce
long t = 0;
long debounce = 1000;
//Audio streaming
AudioInputI2Sslave i2s_slave1; //xy=105,63
AudioOutputUSB usb1; //xy=439,164
AudioConnection patchCord3(i2s_slave1, 0, usb1, 0);
AudioConnection patchCord4(i2s_slave1, 1, usb1, 1);
void setup() {
//Pinmodes
pinMode(steady_state, INPUT_PULLUP);
pinMode(activate, INPUT_PULLUP);
pinMode(streaming, INPUT);
pinMode(vreg, INPUT_PULLUP);
pinMode(play_pause, OUTPUT);
pinMode(blue_led, OUTPUT);
digitalWrite(blue_led,HIGH);
digitalWrite(play_pause, LOW);
//Start serial bus and set rate
Serial.begin(9600);
//Audio Memory Allocation
AudioMemory(100);
}
void loop() {
switch_state = digitalRead(activate);
if (switch_state == HIGH && millis() - t > debounce) {
//Flicker play_pause pin until BC127 is streaming
if (!digitalRead(streaming)) {
while (1) {
digitalWrite(play_pause, HIGH);
digitalWrite(blue_led, LOW);
delay(500);
digitalWrite(play_pause, LOW);
digitalWrite(blue_led, HIGH);
delay(500);
if (digitalRead(streaming)) break;
}
}
t = millis();
}
}
So the device I'm working on is a teensy 3.2, to which is attached a BC127 Bluetooth receiver which receives the audio from 2 microphones attached to the paired transmitter. Channel 1 (Left) receives the audio from an acoustic microphone, Channel 2 (Right) receives the audio from a contact microphone, and both are streamed over usb to the computer (using audacity). I have a Sparkfun navigation switch attached so I can flicker the play/pause pin of the BC127 until it starts receiving audio from the transmitter. Running in (Arduino/Teensyduino) 1.6.12/1.36, everything is fine, I get each mic on the corresponding channel of the stereo stream in audacity. Running in 1.8.5/1.41 I get only the high end of the acoustic microphone on both channels. Hope I've provided enough info, I really appreciate the help.