I know the multiplexer, Texas Instrument chip. At this point I do not know if this will be worth, because I have left only 84 bytes for local variables.
Still, for the price, I will give it a try.
Thanks,
I followed your recommendation, and I have now running the multiplexer.
Still, only one display works, the one connected to output 2, the second display I tried it on output 7, 6, 5, 4, the display is always black. I also tried a second multiplexer. Below is the code.
#include <AudioAnalyzer.h>
#include <Arduino.h>
#include "U8g2lib.h"
#include <Wire.h>
Analyzer Audio = Analyzer(4,5,A0);//Strobe pin ->4 RST pin ->5 Analog Pin ->5
Analyzer AnotherAudio = Analyzer(6,7,A1);//Strobe pin ->6 RST pin ->7 Analog Pin ->5
int FreqVal[7];//
int AnotherFreqVal[7];//
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
U8G2_SSD1306_128X64_NONAME_F_HW_I2C display2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
byte audio_bar_height[7];
byte audio_bar_peak[7];
byte Anotheraudio_bar_height[7];
byte Anotheraudio_bar_peak[7];
void TCA9548A(uint8_t bus)
{
Wire.beginTransmission(0x70); // TCA9548A address is 0x70
Wire.write(1 << bus); // send byte to select bus
Wire.endTransmission();
}
void setup() {
// put your setup code here, to run once:
u8g2.setColorIndex(1);
u8g2.begin();
u8g2.setI2CAddress(0x78);
u8g2.clearDisplay();
display2.begin();
display2.setI2CAddress(0x7A);
display2.clearDisplay();
Wire.begin();
Serial.begin(57600);
Audio.Init();//Init module
}
void loop() {
// put your main code here, to run repeatedly:
Audio.ReadFreq(FreqVal);
TCA9548A(2);
u8g2.clearBuffer();
for (int i=0; i<7; i++){
audio_bar_height[i] = map(max((FreqVal[i]-100),0) ,0 , 1024, 0, 53);
if (audio_bar_peak[i] < audio_bar_height[i]){
audio_bar_peak[i] = audio_bar_height[i];
}else if (audio_bar_peak[i] > audio_bar_height[i]) {
audio_bar_peak[i]--;
}
u8g2.drawBox(2 + i*19, 53- audio_bar_height[i], 10, audio_bar_height[i]);
u8g2.drawBox(2 + i*19, 53 -audio_bar_peak[i],10 ,1 );
u8g2.setFont(u8g2_font_nerhoe_tf);
u8g2.drawStr(2, 64, "63");
u8g2.drawStr(19, 64, "160");
u8g2.drawStr(37, 64, "40");
u8g2.drawStr(60, 64, "1K");
u8g2.drawStr(75, 64, "2.5K");
u8g2.drawStr(95, 64, "6.3K");
u8g2.drawStr(115, 64, "16K");
u8g2.sendBuffer();
}
TCA9548A(5);
display2.clearBuffer();
for (int i=0; i<7; i++){
Anotheraudio_bar_height[i] = map(max((AnotherFreqVal[i] - 100),0) ,0 , 1024, 0, 53);
if (Anotheraudio_bar_peak[i] < Anotheraudio_bar_height[i]){
Anotheraudio_bar_peak[i] = Anotheraudio_bar_height[i];
}else if (Anotheraudio_bar_peak[i] > Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i]--;
}
display2.drawBox(2 + i*19, 53- Anotheraudio_bar_height[i], 10, Anotheraudio_bar_height[i]);
display2.drawBox(2 + i*19, 53 -Anotheraudio_bar_peak[i],10 ,1 );
display2.setFont(u8g2_font_nerhoe_tf);
display2.drawStr(2, 64, "63");
display2.drawStr(19, 64, "160");
display2.drawStr(37, 64, "40");
display2.drawStr(60, 64, "1K");
display2.drawStr(75, 64, "2.5K");
display2.drawStr(95, 64, "6.3K");
display2.drawStr(115, 64, "16K");
display2.sendBuffer();
}
//Audio.ReadFreq(FreqVal);//Return 7 values of 7 bands pass filiter
//AnotherAudio.ReadFreq(AnotherFreqVal);
// for(int i=0;i<7;i++)
// {
// Serial.print(max((FreqVal[i]-100),0));
// if(i<6) Serial.print(",");
// else Serial.println();
// Audio.ReadFreq(FreqVal);//Return 7 values of 7 bands pass filiter
// }
//for(int j=0;j<7;j++)
//{
// Serial.print(max((AnotherFreqVal[j]-100),0));
// if(j<6) Serial.print(",");
// else Serial.println();
// AnotherAudio.ReadFreq(AnotherFreqVal);//Return 7 values of 7 bands pass filter
// }
delay(20);
}
The display part is solved, one display works on output 2 of the multiplexer and the second display works on out 7.
One more problem, the data extracting from the Audio Analyzer v 2.0. the first one on A0 works, the second one on A3 does not work. Here is the code:
#include <AudioAnalyzer.h>
#include <Arduino.h>
#include "U8g2lib.h"
#include <Wire.h>
#define MUX_Address 0x70 // TCA9548A Encoders address
Analyzer Audio = Analyzer(4,5,A0);//Strobe pin ->4 RST pin ->5 Analog Pin ->5
Analyzer AnotherAudio = Analyzer(6,7,A3);//Strobe pin ->6 RST pin ->7 Analog Pin ->5
int FreqVal[7];//
int AnotherFreqVal[7];//
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
U8G2_SSD1306_128X64_NONAME_F_HW_I2C display2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
byte audio_bar_height[7];
byte audio_bar_peak[7];
byte Anotheraudio_bar_height[7];
byte Anotheraudio_bar_peak[7];
void TCA9548A(uint8_t bus)
{
Wire.beginTransmission(0x70); // TCA9548A address is 0x70
Wire.write(1 << bus); // send byte to select bus
Wire.endTransmission();
}
void setup() {
// put your setup code here, to run once:
u8g2.setColorIndex(1);
u8g2.begin();
//u8g2.setI2CAddress(0x78);
u8g2.clearDisplay();
display2.begin();
//display2.setI2CAddress(0x7A);
display2.clearDisplay();
Wire.begin();
Serial.begin(57600);
Audio.Init();//Init module
AnotherAudio.Init();//Init module
}
void loop() {
// put your main code here, to run repeatedly:
Audio.ReadFreq(FreqVal);
TCA9548A(2);
u8g2.clearBuffer();
for (int i=0; i<7; i++){
audio_bar_height[i] = map(max((FreqVal[i]-100),0) ,0 , 1024, 0, 53);
if (audio_bar_peak[i] < audio_bar_height[i]){
audio_bar_peak[i] = audio_bar_height[i];
}else if (audio_bar_peak[i] > audio_bar_height[i]) {
audio_bar_peak[i]--;
}
u8g2.drawBox(2 + i*19, 53- audio_bar_height[i], 10, audio_bar_height[i]);
u8g2.drawBox(2 + i*19, 53 -audio_bar_peak[i],10 ,1 );
u8g2.setFont(u8g2_font_nerhoe_tf);
u8g2.drawStr(2, 64, "63");
u8g2.drawStr(19, 64, "160");
u8g2.drawStr(37, 64, "40");
u8g2.drawStr(60, 64, "1K");
u8g2.drawStr(75, 64, "2.5K");
u8g2.drawStr(95, 64, "6.3K");
u8g2.drawStr(115, 64, "16K");
u8g2.sendBuffer();
}
TCA9548A(7);
AnotherAudio.ReadFreq(AnotherFreqVal);
display2.clearBuffer();
for (int i=0; i<7; i++){
Anotheraudio_bar_height[i] = map(max((AnotherFreqVal[i] - 100),0) ,0 , 1024, 0, 53);
if (Anotheraudio_bar_peak[i] < Anotheraudio_bar_height[i]){
Anotheraudio_bar_peak[i] = Anotheraudio_bar_height[i];
}else if (Anotheraudio_bar_peak[i] > Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i]--;
}
display2.drawBox(2 + i*19, 53- Anotheraudio_bar_height[i], 10, Anotheraudio_bar_height[i]);
display2.drawBox(2 + i*19, 53 -Anotheraudio_bar_peak[i],10 ,1 );
display2.setFont(u8g2_font_nerhoe_tf);
display2.drawStr(2, 64, "63");
display2.drawStr(19, 64, "160");
display2.drawStr(37, 64, "40");
display2.drawStr(60, 64, "1K");
display2.drawStr(75, 64, "2.5K");
display2.drawStr(95, 64, "6.3K");
display2.drawStr(115, 64, "16K");
display2.sendBuffer();
}
//Audio.ReadFreq(FreqVal);//Return 7 values of 7 bands pass filiter
//AnotherAudio.ReadFreq(AnotherFreqVal);
// for(int i=0;i<7;i++)
// {
// Serial.print(max((FreqVal[i]-100),0));
// if(i<6) Serial.print(",");
// else Serial.println();
// Audio.ReadFreq(FreqVal);//Return 7 values of 7 bands pass filiter
// }
//for(int j=0;j<7;j++)
//{
// Serial.print(max((AnotherFreqVal[j]-100),0));
// if(j<6) Serial.print(",");
// else Serial.println();
// AnotherAudio.ReadFreq(AnotherFreqVal);//Return 7 values of 7 bands pass filter
// }
delay(20);
}
That code is commented out. What do you mean one works and the other doesn't?
Make sure you copy/paste/edited correctly.
Try swapping the two anaylzers.
Try using different analog inputs pins, or test the analog input pins.
And so forth.
Try to have fun. ![]()
a7
I think, I did everything, swap the two Audio Analyzers, change the Ax connection and of coarse the code to all from A1 to A7. I might have a code error that I do not see. Here again is the code:
#include <AudioAnalyzer.h>
#include <Arduino.h>
#include "U8g2lib.h"
#include <Wire.h>
#define MUX_Address 0x70 // TCA9548A Encoders address
Analyzer Audio = Analyzer(4,5,A0);//Strobe pin ->4 RST pin ->5 Analog Pin ->5
Analyzer AnotherAudio = Analyzer(6,7,A3);//Strobe pin ->6 RST pin ->7 Analog Pin ->5
int FreqVal[7];//
int AnotherFreqVal[7];//
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
U8G2_SSD1306_128X64_NONAME_F_HW_I2C display2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
byte audio_bar_height[7];
byte audio_bar_peak[7];
byte Anotheraudio_bar_height[7];
byte Anotheraudio_bar_peak[7];
void TCA9548A(uint8_t bus)
{
Wire.beginTransmission(0x70); // TCA9548A address is 0x70
Wire.write(1 << bus); // send byte to select bus
Wire.endTransmission();
}
void setup() {
// put your setup code here, to run once:
u8g2.setColorIndex(1);
u8g2.begin();
//u8g2.setI2CAddress(0x78);
u8g2.clearDisplay();
display2.begin();
//display2.setI2CAddress(0x7A);
display2.clearDisplay();
Wire.begin();
Serial.begin(57600);
Audio.Init();//Init module
AnotherAudio.Init();//Init module
}
void loop() {
// put your main code here, to run repeatedly:
Audio.ReadFreq(FreqVal);
TCA9548A(2);
u8g2.clearBuffer();
for (int i=0; i<7; i++){
audio_bar_height[i] = map(max((FreqVal[i]-100),0) ,0 , 1024, 0, 53);
if (audio_bar_peak[i] < audio_bar_height[i]){
audio_bar_peak[i] = audio_bar_height[i];
}else if (audio_bar_peak[i] > audio_bar_height[i]) {
audio_bar_peak[i]--;
}
u8g2.drawBox(2 + i*19, 53- audio_bar_height[i], 10, audio_bar_height[i]);
u8g2.drawBox(2 + i*19, 53 -audio_bar_peak[i],10 ,1 );
u8g2.setFont(u8g2_font_nerhoe_tf);
u8g2.drawStr(2, 64, "63");
u8g2.drawStr(19, 64, "160");
u8g2.drawStr(37, 64, "40");
u8g2.drawStr(60, 64, "1K");
u8g2.drawStr(75, 64, "2.5K");
u8g2.drawStr(95, 64, "6.3K");
u8g2.drawStr(115, 64, "16K");
u8g2.sendBuffer();
}
TCA9548A(7);
AnotherAudio.ReadFreq(AnotherFreqVal);
display2.clearBuffer();
for (int i=0; i<7; i++){
Anotheraudio_bar_height[i] = map(max((AnotherFreqVal[i] - 100),0) ,0 , 1024, 0, 53);
if (Anotheraudio_bar_peak[i] < Anotheraudio_bar_height[i]){
Anotheraudio_bar_peak[i] = Anotheraudio_bar_height[i];
}else if (Anotheraudio_bar_peak[i] > Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i]--;
}
display2.drawBox(2 + i*19, 53- Anotheraudio_bar_height[i], 10, Anotheraudio_bar_height[i]);
display2.drawBox(2 + i*19, 53 -Anotheraudio_bar_peak[i],10 ,1 );
display2.setFont(u8g2_font_nerhoe_tf);
display2.drawStr(2, 64, "63");
display2.drawStr(19, 64, "160");
display2.drawStr(37, 64, "40");
display2.drawStr(60, 64, "1K");
display2.drawStr(75, 64, "2.5K");
display2.drawStr(95, 64, "6.3K");
display2.drawStr(115, 64, "16K");
display2.sendBuffer();
}
//Audio.ReadFreq(FreqVal);//Return 7 values of 7 bands pass filiter
//AnotherAudio.ReadFreq(AnotherFreqVal);
// for(int i=0;i<7;i++)
// {
// Serial.print(max((FreqVal[i]-100),0));
// if(i<6) Serial.print(",");
// else Serial.println();
// Audio.ReadFreq(FreqVal);//Return 7 values of 7 bands pass filiter
// }
//for(int j=0;j<7;j++)
//{
// Serial.print(max((AnotherFreqVal[j]-100),0));
// if(j<6) Serial.print(",");
// else Serial.println();
// AnotherAudio.ReadFreq(AnotherFreqVal);//Return 7 values of 7 bands pass filter
// }
delay(20);
}
Thanks,
These need to be switched. Select the analyzer, then read the frequencies. Just make the code two sections, one for each analyzer/OLED combo
TCA9548A(2);
Audio.ReadFreq(FreqVal);
// bars
// serail printing
Then lose the repeated copies of the read method.
ReadFreq() each analyzer once per loop(). Do not read them again before the printing section you still have commented out, do not reread them every iteration of the for loops that do the printing.
TBC I think you need one call to each analyzer for a total of only two calls to ReadFreq(). Do it at the top of the loop(). section.
Checking… hang on. Yeth. I agree with myself.
Sry, in transit. I hope it makes sense. All I got.
a7
Here. I separated the two completely and provided for turning each on and off. By placing each in its own if statement.
Find
if (1) { // change 1 to 0 and the the first analyser/OLED will simply not execute
at the top of each. Try running one, the other and then both.
#include <AudioAnalyzer.h>
#include <Arduino.h>
#include "U8g2lib.h"
#include <Wire.h>
#define MUX_Address 0x70
Analyzer Audio = Analyzer(4, 5, A0); //Strobe pin ->4 RST pin ->5 Analog Pin ->5
Analyzer AnotherAudio = Analyzer(6, 7, A3); //Strobe pin ->6 RST pin ->7 Analog Pin ->5
int FreqVal[7];//
int AnotherFreqVal[7];//
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
U8G2_SSD1306_128X64_NONAME_F_HW_I2C display2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
byte audio_bar_height[7];
byte audio_bar_peak[7];
byte Anotheraudio_bar_height[7];
byte Anotheraudio_bar_peak[7];
void TCA9548A(uint8_t bus)
{
Wire.beginTransmission(0x70); // TCA9548A address is 0x70
Wire.write(1 << bus); // send byte to select bus
Wire.endTransmission();
}
void setup() {
u8g2.setColorIndex(1);
u8g2.begin();
//u8g2.setI2CAddress(0x78);
u8g2.clearDisplay();
display2.begin();
//display2.setI2CAddress(0x7A);
display2.clearDisplay();
Wire.begin();
Serial.begin(57600);
Audio.Init();
AnotherAudio.Init();
}
void loop() {
if (1) { // change 1 to 0 and the the first analyser/OLED will simply not execute
TCA9548A(2);
Audio.ReadFreq(FreqVal);
u8g2.clearBuffer();
for (int i = 0; i < 7; i++) {
audio_bar_height[i] = map(max((FreqVal[i] - 100), 0), 0, 1024, 0, 53);
if (audio_bar_peak[i] < audio_bar_height[i]) {
audio_bar_peak[i] = audio_bar_height[i];
} else if (audio_bar_peak[i] > audio_bar_height[i]) {
audio_bar_peak[i]--;
}
u8g2.drawBox(2 + i * 19, 53 - audio_bar_height[i], 10, audio_bar_height[i]);
u8g2.drawBox(2 + i * 19, 53 - audio_bar_peak[i], 10, 1 );
u8g2.setFont(u8g2_font_nerhoe_tf);
u8g2.drawStr(2, 64, "63");
u8g2.drawStr(19, 64, "160");
u8g2.drawStr(37, 64, "40");
u8g2.drawStr(60, 64, "1K");
u8g2.drawStr(75, 64, "2.5K");
u8g2.drawStr(95, 64, "6.3K");
u8g2.drawStr(115, 64, "16K");
u8g2.sendBuffer();
}
for (int i = 0; i < 7; i++)
{
Serial.print(max((FreqVal[i] - 100), 0));
if (i < 6) Serial.print(",");
else Serial.println();
}
}
if (1) { // change 1 to 0 and the the second analyser/OLED will simply not execute
TCA9548A(7);
AnotherAudio.ReadFreq(AnotherFreqVal);
display2.clearBuffer();
for (int i = 0; i < 7; i++) {
Anotheraudio_bar_height[i] = map(max((AnotherFreqVal[i] - 100), 0), 0, 1024, 0, 53);
if (Anotheraudio_bar_peak[i] < Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i] = Anotheraudio_bar_height[i];
} else if (Anotheraudio_bar_peak[i] > Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i]--;
}
display2.drawBox(2 + i * 19, 53 - Anotheraudio_bar_height[i], 10, Anotheraudio_bar_height[i]);
display2.drawBox(2 + i * 19, 53 - Anotheraudio_bar_peak[i], 10, 1 );
display2.setFont(u8g2_font_nerhoe_tf);
display2.drawStr(2, 64, "63");
display2.drawStr(19, 64, "160");
display2.drawStr(37, 64, "40");
display2.drawStr(60, 64, "1K");
display2.drawStr(75, 64, "2.5K");
display2.drawStr(95, 64, "6.3K");
display2.drawStr(115, 64, "16K");
display2.sendBuffer();
}
for (int j = 0; j < 7; j++)
{
Serial.print(max((AnotherFreqVal[j] - 100), 0));
if (j < 6) Serial.print(",");
else Serial.println();
}
}
delay(20);
}
HTH
a7
Your split technique was very useful. Results after using the split. We are talking about two channels, channel 1 (connected to A0) and channel 2 (connected to A6).
When running only channel 1, it behaves like there is no data to be displayed even if I swapped the Audio Analyzers.
When running only channel 2, even without any audio signal applied the display continuously displays. Following is the code.
#include <AudioAnalyzer.h>
#include <Arduino.h>
#include "U8g2lib.h"
#include <Wire.h>
#define MUX_Address 0x70
Analyzer Audio = Analyzer(4, 5, A0); //Strobe pin ->4 RST pin ->5 Analog Pin ->5
Analyzer AnotherAudio = Analyzer(6, 7, A6); //Strobe pin ->6 RST pin ->7 Analog Pin ->5
int FreqVal[7];//
int AnotherFreqVal[7];//
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
U8G2_SSD1306_128X64_NONAME_F_HW_I2C display2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE, /* clock=*/ 16, /* data=*/ 17); // ESP32 Thing, HW I2C with pin remapping
byte audio_bar_height[7];
byte audio_bar_peak[7];
byte Anotheraudio_bar_height[7];
byte Anotheraudio_bar_peak[7];
void TCA9548A(uint8_t bus)
{
Wire.beginTransmission(0x70); // TCA9548A address is 0x70
Wire.write(1 << bus); // send byte to select bus
Wire.endTransmission();
}
void setup() {
u8g2.setColorIndex(1);
u8g2.begin();
//u8g2.setI2CAddress(0x78);
u8g2.clearDisplay();
display2.begin();
//display2.setI2CAddress(0x7A);
display2.clearDisplay();
Wire.begin();
Serial.begin(57600);
Audio.Init();
AnotherAudio.Init();
}
void loop() {
if (1) { // change 1 to 0 and the the first analyser/OLED will simply not execute
TCA9548A(2);
Audio.ReadFreq(FreqVal);
u8g2.clearBuffer();
for (int i = 0; i < 7; i++) {
audio_bar_height[i] = map(max((FreqVal[i] - 100), 0), 0, 1024, 0, 53);
if (audio_bar_peak[i] < audio_bar_height[i]) {
audio_bar_peak[i] = audio_bar_height[i];
} else if (audio_bar_peak[i] > audio_bar_height[i]) {
audio_bar_peak[i]--;
}
u8g2.drawBox(2 + i * 19, 53 - audio_bar_height[i], 10, audio_bar_height[i]);
u8g2.drawBox(2 + i * 19, 53 - audio_bar_peak[i], 10, 1 );
u8g2.setFont(u8g2_font_nerhoe_tf);
u8g2.drawStr(2, 64, "63");
u8g2.drawStr(19, 64, "160");
u8g2.drawStr(37, 64, "40");
u8g2.drawStr(60, 64, "1K");
u8g2.drawStr(75, 64, "2.5K");
u8g2.drawStr(95, 64, "6.3K");
u8g2.drawStr(115, 64, "16K");
u8g2.sendBuffer();
}
for (int i = 0; i < 7; i++)
{
Serial.print(max((FreqVal[i] - 100), 0));
if (i < 6) Serial.print(",");
else Serial.println();
}
}
if (0) { // change 1 to 0 and the the second analyser/OLED will simply not execute
TCA9548A(7);
AnotherAudio.ReadFreq(AnotherFreqVal);
display2.clearBuffer();
for (int i = 0; i < 7; i++) {
Anotheraudio_bar_height[i] = map(max((AnotherFreqVal[i] - 100), 0), 0, 1024, 0, 53);
if (Anotheraudio_bar_peak[i] < Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i] = Anotheraudio_bar_height[i];
} else if (Anotheraudio_bar_peak[i] > Anotheraudio_bar_height[i]) {
Anotheraudio_bar_peak[i]--;
}
display2.drawBox(2 + i * 19, 53 - Anotheraudio_bar_height[i], 10, Anotheraudio_bar_height[i]);
display2.drawBox(2 + i * 19, 53 - Anotheraudio_bar_peak[i], 10, 1 );
display2.setFont(u8g2_font_nerhoe_tf);
display2.drawStr(2, 64, "63");
display2.drawStr(19, 64, "160");
display2.drawStr(37, 64, "40");
display2.drawStr(60, 64, "1K");
display2.drawStr(75, 64, "2.5K");
display2.drawStr(95, 64, "6.3K");
display2.drawStr(115, 64, "16K");
display2.sendBuffer();
}
for (int j = 0; j < 7; j++)
{
Serial.print(max((AnotherFreqVal[j] - 100), 0));
if (j < 6) Serial.print(",");
else Serial.println();
}
}
delay(20);
}
Is there a way to send a short video, here, to maybe clarify?
Even with Audio Analyzer disconnected and A6 to the ground the channels displays data.
Finally I had it working on both channels, still not for long time, after 30 seconds one of the channels (multiple resets) starts having an disturbing hysteresis, running like that for a few minutes every freezes on the displays, serial out showing good output. My unexperienced one feeling, is that Arduino Nano is not powerful enough in resources and speed. I even had interference in between the channels. I even tried to feed the Ax of the Arduino input through an opamp as follower. Thank you all!!! I will build the stereo version using two Arduino Nano, that actually works well.
Thank you, all guys, you can close this.
Using two copies of the hardware is certainly a reasonable solution.
But it is unsatisfactory, and as a teacher once told me in high school indicates a 'lack of intellectual curiosity".
Either there is no reason this shouldn't work, or a very good reason why it does not. Knowing the answer might inform future designs.
Without all the real kit you are throwing at this, no one can work toward the answer, which for all we know may be something very simple and possibly unrelated to the software.
I'm not going to spend time on it, and you are being practical and have decided to stop having fun chewing on lemon peels.
As I have said in other similar circumstances, "you happy, we happy".
Please do report when you get your two monophonic OLED analyzers to function in the manner you desire, then we add
"I do not argue with success."
Seems like I should work "time is money" in there somewhere.
Issues close automatically when there is no more traffic, and live forever for whatever good they may ever do anybody who searches these fora with a similar issue.
a7
The dual hardware mono version was already working since my previous message.
Maybe the code I was looking for, stereo, on the same Arduino could be optimized, out of my current knowledge. Thank you for your help and in between the line very gently insulting comments. We do not all have the chance to be born as smart to your level.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.