colorado_hick
Well-known member
Based on my research, I understand that the 0 and 1 channels on a AudioOutputI2S would be the right and left audio output.
This is a teensy 3.6 board with the audio shield
However my experiment is suggesting otherwise, this code beeps in both 'ears' each time instead of alternating. I also tried it using different frequencies, still no luck. any ideas?
This is a teensy 3.6 board with the audio shield
However my experiment is suggesting otherwise, this code beeps in both 'ears' each time instead of alternating. I also tried it using different frequencies, still no luck. any ideas?
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
AudioSynthWaveform waveform[2];
AudioOutputI2S i2s1;
AudioControlSGTL5000 sgtl5000_1;
AudioConnection patchCord1(waveform[0], 0, i2s1, 1);
AudioConnection patchCord2(waveform[1], 0, i2s1, 0);
void setup() {
// put your setup code here, to run once:
// get up control buttons
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
Serial.println("startin up....");
AudioMemory(20);
sgtl5000_1.enable();
sgtl5000_1.volume(0.3);
waveform[0].begin(WAVEFORM_SINE);
waveform[0].frequency(440);
waveform[1].begin(WAVEFORM_SINE);
waveform[1].frequency(440);
}
void loop() {
waveform[0].amplitude(.5);
delay(200);
waveform[0].amplitude(0);
delay(2000);
waveform[1].amplitude(.5);
delay(200);
waveform[1].amplitude(0);
}