You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
58 lines
1.5 KiB
#include <Arduino.h>
|
|
#include <Audio.h>
|
|
#include <Wire.h>
|
|
#include <SPI.h>
|
|
#include <effect_delay_ext8.h>
|
|
|
|
AudioSynthWaveformSine sine1;
|
|
AudioEffectDelayExternal8 delayExt1(AUDIO_MEMORY8_EXTMEM, 20000);
|
|
AudioMixer4 mixer1;
|
|
AudioOutputI2S i2s1;
|
|
AudioConnection patchCord2(sine1, delayExt1);
|
|
AudioConnection patchCord3(sine1, 0, mixer1, 0);
|
|
AudioConnection patchCord4(delayExt1, 0, mixer1, 1);
|
|
AudioConnection patchCord5(delayExt1, 1, mixer1, 2);
|
|
AudioConnection patchCord6(delayExt1, 2, mixer1, 3);
|
|
AudioConnection patchCord7(mixer1, 0, i2s1, 0);
|
|
AudioConnection patchCord8(mixer1, 0, i2s1, 1);
|
|
AudioControlSGTL5000 sgtl5000;
|
|
|
|
void setup() {
|
|
Serial.begin(230400);
|
|
delay(50);
|
|
Serial.println("<setup begin>");
|
|
|
|
AudioMemory(100);
|
|
|
|
sgtl5000.enable();
|
|
sgtl5000.lineOutLevel(29);
|
|
sgtl5000.dacVolumeRamp();
|
|
sgtl5000.dacVolume(1.0);
|
|
sgtl5000.unmuteHeadphone();
|
|
sgtl5000.unmuteLineout();
|
|
sgtl5000.volume(0.8, 0.8); // Headphone volume
|
|
sgtl5000.audioProcessorDisable();
|
|
sgtl5000.autoVolumeDisable();
|
|
sgtl5000.surroundSoundDisable();
|
|
sgtl5000.enhanceBassDisable();
|
|
delayExt1.delay(0, 1333);
|
|
delayExt1.delay(1, 1664);
|
|
delayExt1.delay(2, 2000);
|
|
sine1.amplitude(1.0);
|
|
sine1.frequency(440.0);
|
|
mixer1.gain(0, 1.0);
|
|
mixer1.gain(1, 0.5);
|
|
mixer1.gain(2, 0.5);
|
|
mixer1.gain(3, 0.5);
|
|
|
|
Serial.println("<setup end>");
|
|
}
|
|
|
|
void loop() {
|
|
Serial.print("<SINE>");
|
|
sine1.amplitude(1.0);
|
|
delay(200);
|
|
sine1.amplitude(0.0);
|
|
Serial.println("</SINE> (You should hear three quiter delays)");
|
|
delay(5000);
|
|
}
|
|
|