so this is not quite a problem, but more of a curiosity...
when I run the code below, it works fine, and will print out what frequency is being analyzed.
The curiosity is when I delete the AudioOutputAnaloc dac; line, it no longer prints out the frequencies (noteFreq.available() is never true)...
Is this a bug, or expected behavior?
when I run the code below, it works fine, and will print out what frequency is being analyzed.
The curiosity is when I delete the AudioOutputAnaloc dac; line, it no longer prints out the frequencies (noteFreq.available() is never true)...
Is this a bug, or expected behavior?
Code:
#include <Audio.h>
#include <SPI.h>
#include <Wire.h>
AudioOutputAnalog dac;
AudioSynthWaveformSine sine;
AudioAnalyzeNoteFrequency notefreq;
AudioConnection patchCord1(sine, 0, notefreq, 0);
void setup() {
AudioMemory(30);
sine.amplitude(1.0);
sine.frequency(2000);
notefreq.begin(.15);
Serial.begin(9600);
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH);
delay(100);
digitalWrite(13, LOW);
delay(100);
Serial.println(String( millis() ) + "\t");
if (notefreq.available()) {
float note = notefreq.read();
float prob = notefreq.probability();
Serial.printf("Note: %3.2f | Probability: %.2f\n", note, prob);
}
}