I have tested a Teensy 3.1 with an audio board attached with the following included sketch.
/* Mono Peak Meter
Scrolling peak audio level meter in the Arduino Serial Monitor
Audio input needs to connect to pin 16 (A2). The signal range is 0 to 1.2V.
See the documentation in the Audio System Design Tool for the recommended
circuit to connect an analog signal.
This example code is in the public domain
*/
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
// GUItool: begin automatically generated code
AudioInputAnalog adc1;
AudioOutputI2S i2s1;
AudioAnalyzePeak peak1;
AudioConnection patchCord1(adc1, peak1);
AudioConnection patchCord2(adc1, 0, i2s1, 0);
AudioConnection patchCord3(adc1, 0, i2s1, 1);
// GUItool: end automatically generated code
void setup() {
AudioMemory(4);
Serial.begin(9600);
}
// for best effect make your terminal/monitor a minimum of 31 chars wide and as high as you can.
elapsedMillis fps;
void loop() {
if (fps > 24) {
if (peak1.available()) {
fps = 0;
int monoPeak = peak1.read() * 30.0;
Serial.print("|");
for (int cnt=0; cnt<monoPeak; cnt++) {
Serial.print(">");
}
Serial.println();
}
}
}
It works perfectly when using the Arduino 1.0.6 IDE with the teensyduino version prior to 1.24
But when I try run the sketch in Arduino 1.6.5 IDE with teensyduino 1.24. I get no serial output and no audio output.
Even though the program compiles fine with no errors in both.
Can you not use an older physical Teensy 3.1 with the new IDE and teensyduino?
/* Mono Peak Meter
Scrolling peak audio level meter in the Arduino Serial Monitor
Audio input needs to connect to pin 16 (A2). The signal range is 0 to 1.2V.
See the documentation in the Audio System Design Tool for the recommended
circuit to connect an analog signal.
This example code is in the public domain
*/
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
// GUItool: begin automatically generated code
AudioInputAnalog adc1;
AudioOutputI2S i2s1;
AudioAnalyzePeak peak1;
AudioConnection patchCord1(adc1, peak1);
AudioConnection patchCord2(adc1, 0, i2s1, 0);
AudioConnection patchCord3(adc1, 0, i2s1, 1);
// GUItool: end automatically generated code
void setup() {
AudioMemory(4);
Serial.begin(9600);
}
// for best effect make your terminal/monitor a minimum of 31 chars wide and as high as you can.
elapsedMillis fps;
void loop() {
if (fps > 24) {
if (peak1.available()) {
fps = 0;
int monoPeak = peak1.read() * 30.0;
Serial.print("|");
for (int cnt=0; cnt<monoPeak; cnt++) {
Serial.print(">");
}
Serial.println();
}
}
}
It works perfectly when using the Arduino 1.0.6 IDE with the teensyduino version prior to 1.24
But when I try run the sketch in Arduino 1.6.5 IDE with teensyduino 1.24. I get no serial output and no audio output.
Even though the program compiles fine with no errors in both.
Can you not use an older physical Teensy 3.1 with the new IDE and teensyduino?