Getting wired value from MSGEQ7
i'm newbie on arduino. trying read volume msgeq7 module. 1 chip gives me 0 time, , gives me 229 or 230, both ignoring input. i'm confused.
i used nodemcu 1.0 (esp8266 esp12e breakout board), not sure if matters. input earphone jack of computer display.
program:
#include "msgeq7.h"
#define pinanalog a0
#define pinreset 2
#define pinstrobe 12
#define msgeq7_interval readspersecond(50)
#define msgeq7_smooth 0 // range: 0-255
cmsgeq7<msgeq7_smooth, pinreset, pinstrobe, pinanalog> msgeq7;
void setup() {
// set ic ready reading
msgeq7.begin();
serial.begin(115200);
}
void loop() {
// analyze without delay every interval
bool newreading = msgeq7.read(msgeq7_interval);
if (newreading) {
serial.write("vol: ");
serial.println(msgeq7.getvolume());
}
}
breadboard settings photo attached.
i used nodemcu 1.0 (esp8266 esp12e breakout board), not sure if matters. input earphone jack of computer display.
program:
#include "msgeq7.h"
#define pinanalog a0
#define pinreset 2
#define pinstrobe 12
#define msgeq7_interval readspersecond(50)
#define msgeq7_smooth 0 // range: 0-255
cmsgeq7<msgeq7_smooth, pinreset, pinstrobe, pinanalog> msgeq7;
void setup() {
// set ic ready reading
msgeq7.begin();
serial.begin(115200);
}
void loop() {
// analyze without delay every interval
bool newreading = msgeq7.read(msgeq7_interval);
if (newreading) {
serial.write("vol: ");
serial.println(msgeq7.getvolume());
}
}
breadboard settings photo attached.
note - i've never used msgeq7 understand concept of how works...
did write code or known-working example?
the msgeq7 timing critical , if it's not known-good code, serial print statements might messing-up timing. serial communication slow-down loop.
you may need run awhile until it's giving data , print data, maybe once per second or once ever few seconds instead of printing every time through loop. you'd use millis() in blink without delay example.
did write code or known-working example?
the msgeq7 timing critical , if it's not known-good code, serial print statements might messing-up timing. serial communication slow-down loop.
you may need run awhile until it's giving data , print data, maybe once per second or once ever few seconds instead of printing every time through loop. you'd use millis() in blink without delay example.
Arduino Forum > Using Arduino > Audio > Getting wired value from MSGEQ7
arduino
Comments
Post a Comment