Hi guys,
I m trying a simple project with Teensy 3.1. I want to read and adc input and perform an fft on it. For troubleshooting I cutout all the irrelevant code and I am left with this.
The problem is that myFFT.available() call always returns a 0.
I have an adafruit electret microphone I am powering from the teensy 3.3Vout. I can disconnect it - no difference. I know the code runs since the LED blinks and I do get some output on the serial monitor.
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputAnalog adc1;
AudioAnalyzeFFT1024 myFFT;
AudioConnection patchCord1(adc1, 0, myFFT, 0);
// GUItool: end automatically generated code
float level[16];
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
AudioMemory(12);
pinMode(10, OUTPUT);
// Configure the window algorithm to use
myFFT.windowFunction(AudioWindowHanning1024);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("start: ");
digitalWriteFast(10, !digitalReadFast(10));
Serial.println(myFFT.available());
delay(100);
level[1] = myFFT.read(1);
Serial.println(level[1]);
Serial.print(" cpu:");
Serial.println(AudioProcessorUsageMax());
// delay(1000);
}
Any thoughts on why I keep getting myFFT.available() always = 0?
Thanks
I m trying a simple project with Teensy 3.1. I want to read and adc input and perform an fft on it. For troubleshooting I cutout all the irrelevant code and I am left with this.
The problem is that myFFT.available() call always returns a 0.
I have an adafruit electret microphone I am powering from the teensy 3.3Vout. I can disconnect it - no difference. I know the code runs since the LED blinks and I do get some output on the serial monitor.
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputAnalog adc1;
AudioAnalyzeFFT1024 myFFT;
AudioConnection patchCord1(adc1, 0, myFFT, 0);
// GUItool: end automatically generated code
float level[16];
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
AudioMemory(12);
pinMode(10, OUTPUT);
// Configure the window algorithm to use
myFFT.windowFunction(AudioWindowHanning1024);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println("start: ");
digitalWriteFast(10, !digitalReadFast(10));
Serial.println(myFFT.available());
delay(100);
level[1] = myFFT.read(1);
Serial.println(level[1]);
Serial.print(" cpu:");
Serial.println(AudioProcessorUsageMax());
// delay(1000);
}
Any thoughts on why I keep getting myFFT.available() always = 0?
Thanks