Howdy,
This is an odd problem. I started following through the Audio tutorial series with my new Audio Tutorial Kit. Everything works fine up to the delay tutorial, but then that one just does not work (I cannot hear anything from the microphone, even though the microphone works fine with the mic test tutorial example).
Here's the series of tests that shows this is actually something odd, not just me screwing up:
- loading up the same exact code from a friend's laptop onto my Teensy, it works fine
- using my laptop to load up the code onto another identical Teensy, it fails
Thus, it is clearly a problem along the lines of something with the compiling process on my laptop. It is not a problem with my hardware, nor is it a problem with the code itself (which I am attaching anyway so that I don't break the forum rule!). It is not obviously some sort of version thing with Arduino or Teensyduino, as my friend and I are using identical versions of both (Arduino 1.8.2, Teensyduino 1.36), and we are using them on the same version of Mac OSX (10.11.6).
Since the microphone test tutorial code worked fine, I started there and just started adding things until it "broke." I discovered that adding a few other objects (like the delay object) didn't make it break, but as soon as I added in any connection(s), it ceased working. Although honestly I doubt that is a clue to much of anything.
My next step is to update Xcode... I am a bit behind on that (version 8.2.1.... I was just guessing this is being used somewhere for the actual C compilers?). This is my first session working with Arduino or Teensy at all so I'm not up to speed yet on any of the software setup.... just immediately got stuck on this problem and it has the flavor of something buggy, so I thought I should say something about it. Hopefully not wasting anyone's time!
Below is the vanilla tutorial code that works fine when compiled on friend's laptop but not when compiled on mine. There are no error messages when I compile and load this. The hardware setup is the Audio Tutorial Kit straight from my mailbox, no changes.
This is an odd problem. I started following through the Audio tutorial series with my new Audio Tutorial Kit. Everything works fine up to the delay tutorial, but then that one just does not work (I cannot hear anything from the microphone, even though the microphone works fine with the mic test tutorial example).
Here's the series of tests that shows this is actually something odd, not just me screwing up:
- loading up the same exact code from a friend's laptop onto my Teensy, it works fine
- using my laptop to load up the code onto another identical Teensy, it fails
Thus, it is clearly a problem along the lines of something with the compiling process on my laptop. It is not a problem with my hardware, nor is it a problem with the code itself (which I am attaching anyway so that I don't break the forum rule!). It is not obviously some sort of version thing with Arduino or Teensyduino, as my friend and I are using identical versions of both (Arduino 1.8.2, Teensyduino 1.36), and we are using them on the same version of Mac OSX (10.11.6).
Since the microphone test tutorial code worked fine, I started there and just started adding things until it "broke." I discovered that adding a few other objects (like the delay object) didn't make it break, but as soon as I added in any connection(s), it ceased working. Although honestly I doubt that is a clue to much of anything.
My next step is to update Xcode... I am a bit behind on that (version 8.2.1.... I was just guessing this is being used somewhere for the actual C compilers?). This is my first session working with Arduino or Teensy at all so I'm not up to speed yet on any of the software setup.... just immediately got stuck on this problem and it has the flavor of something buggy, so I thought I should say something about it. Hopefully not wasting anyone's time!
Below is the vanilla tutorial code that works fine when compiled on friend's laptop but not when compiled on mine. There are no error messages when I compile and load this. The hardware setup is the Audio Tutorial Kit straight from my mailbox, no changes.
Code:
// Advanced Microcontroller-based Audio Workshop
//
// http://www.pjrc.com/store/audio_tutorial_kit.html
// https://hackaday.io/project/8292-microcontroller-audio-workshop-had-supercon-2015
//
// Part 2-5: Simple Delay
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioInputI2S i2s2; //xy=80.44999694824219,124.44999694824219
AudioEffectDelay delay1; //xy=187.4499969482422,296.4499969482422
AudioMixer4 mixer1; //xy=342.45001220703125,200.4499969482422
AudioMixer4 mixer2; //xy=367.45001220703125,367.45001220703125
AudioMixer4 mixer3; //xy=573.4499969482422,181.4499969482422
AudioOutputI2S i2s1; //xy=788.4499969482422,173.4499969482422
AudioConnection patchCord1(i2s2, 0, mixer3, 0);
AudioConnection patchCord2(i2s2, 1, delay1, 0);
AudioConnection patchCord3(delay1, 0, mixer1, 0);
AudioConnection patchCord4(delay1, 1, mixer1, 1);
AudioConnection patchCord5(delay1, 2, mixer1, 2);
AudioConnection patchCord6(delay1, 3, mixer1, 3);
AudioConnection patchCord7(delay1, 4, mixer2, 0);
AudioConnection patchCord8(delay1, 5, mixer2, 1);
AudioConnection patchCord9(delay1, 6, mixer2, 2);
AudioConnection patchCord10(delay1, 7, mixer2, 3);
AudioConnection patchCord11(mixer1, 0, mixer3, 1);
AudioConnection patchCord12(mixer2, 0, mixer3, 2);
AudioConnection patchCord13(mixer3, 0, i2s1, 0);
AudioConnection patchCord14(mixer3, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=689.4500122070312,294.45001220703125
// GUItool: end automatically generated code
void setup() {
Serial.begin(9600);
AudioMemory(160);
sgtl5000_1.enable();
sgtl5000_1.volume(0.6);
sgtl5000_1.inputSelect(AUDIO_INPUT_MIC);
sgtl5000_1.micGain(36);
mixer1.gain(0, 0.2);
mixer1.gain(1, 0.2);
mixer1.gain(2, 0.2);
mixer1.gain(3, 0.2);
mixer2.gain(0, 0.2);
mixer2.gain(1, 0.2);
mixer2.gain(2, 0.2);
mixer2.gain(3, 0.2);
mixer3.gain(0, 0.0); // default = do not listen to direct signal
mixer3.gain(1, 1.0); // ch1 is output of mixer1
mixer3.gain(2, 1.0); // ch2 is output of mixer2
delay1.delay(0, 400);
delay1.delay(1, 400);
delay1.delay(2, 400);
delay1.delay(3, 400);
delay1.delay(4, 400);
delay1.delay(5, 400);
delay1.delay(6, 400);
delay1.delay(7, 400);
delay(1000);
}
void loop() {
// do nothing
}