I just got the audio shield for the teensy 4.0 and I'm having trouble getting sound out of it. My project requires that I have the shield separate from the teensy so I have them both mounted to a breadboard and I'm trying to wire it up just to the pins on the teensy needed to get sound out of the headphone jack. According to the docs on the I2S interface I need to have pins 7, 20, 21, and 23 connected. I connected these from the teensy to the corresponding pin numbers on the audio shield. I of course have the 3v, 5v and ground connected as well. When I run my code I don't hear anything. My sketch is just an oscillator connected straight to the audio out. Here is the sketch I'm trying to run:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=255,276
AudioOutputI2S i2s1; //xy=505,274
AudioConnection patchCord1(waveform1, 0, i2s1, 0);
AudioConnection patchCord2(waveform1, 0, i2s1, 1);
AudioControlSGTL5000 sgtl5000_1; //xy=511,326
// GUItool: end automatically generated code
void setup() {
// put your setup code here, to run once:
sgtl5000_1.enable();
sgtl5000_1.volume(0.5);
waveform1.begin(WAVEFORM_SINE);
waveform1.amplitude(0.5);
waveform1.frequency(220);
waveform1.pulseWidth(0.15);
}
void loop() {
// put your main code here, to run repeatedly:
}
What am I doing wrong here?