Queue Audio object and i2c issue
Hi, i have a stranger issue with the queue audio object and i2c components in my T4 and Audio Shield rev D project.
When begin the queue while a i2c display (or multiplexer or anything) is working the audio stream is stopped and the queue object don't works.
Looks like a freeze..
In this sketch the freezing appears when I press the button and disappears when I release the button.
If I stop the i2c stream (removing display line in loop) the queue object works fine.
I can't understand what's happening.
can you help me?
Thank u
Hi, i have a stranger issue with the queue audio object and i2c components in my T4 and Audio Shield rev D project.
When begin the queue while a i2c display (or multiplexer or anything) is working the audio stream is stopped and the queue object don't works.
Looks like a freeze..
In this sketch the freezing appears when I press the button and disappears when I release the button.
If I stop the i2c stream (removing display line in loop) the queue object works fine.
I can't understand what's happening.
Code:
#include <Bounce2.h>
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <Adafruit_SSD1306.h>
#include <Adafruit_GFX.h>
AudioInputI2S line_in; //xy=156,246
AudioAnalyzePeak peak1; //xy=590,456
AudioRecordQueue queue_left; //xy=484,188
AudioRecordQueue queue_right; //xy=498,241
AudioOutputI2S i2s2; //xy=682,409
AudioConnection patchCord1(line_in, 0, queue_left, 0);
AudioConnection patchCord2(line_in, 1, queue_right, 0);
AudioConnection patchCord3(line_in, 0, peak1, 0);
AudioConnection patchCord4(line_in, 0, i2s2,0);
AudioConnection patchCord5(line_in, 0, i2s2, 1);
AudioControlSGTL5000 sgtl5000_1;
#define BOUNCE_LOCK_OUT
Bounce button1 = Bounce(9, 5);
#define OLED_RESET -1
Adafruit_SSD1306 display(OLED_RESET);
void setup() {
button1.attach( 9, INPUT_PULLUP );
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
AudioMemory(60);
sgtl5000_1.enable();
}
void loop() {
display.clearDisplay();
button1.update();
if (button1.fell()) {queue_left.begin(); queue_right.begin();}
if (button1.rose()) {queue_right.end(); queue_left.end();
queue_left.clear();queue_right.clear();}
if (peak1.available()) {display.setCursor(35,25); display.setTextSize(2); display.setTextColor(WHITE); display.print(peak1.read());}
display.display();
}
can you help me?
Thank u