|
|
|
#include <Audio.h>
|
|
|
|
#include <Wire.h>
|
|
|
|
#include <SPI.h>
|
|
|
|
#include <effect_delay_ext8.h>
|
|
|
|
|
|
|
|
// GUItool: begin automatically generated code
|
|
|
|
AudioSynthWaveformSine sine1; //xy=382,432
|
|
|
|
AudioAmplifier amp1; //xy=606,441
|
|
|
|
AudioEffectDelayExternal delayExt1; //xy=770,321
|
|
|
|
AudioMixer4 mixer1; //xy=983,386
|
|
|
|
AudioOutputI2S i2s1; //xy=1131,343
|
|
|
|
AudioConnection patchCord1(sine1, amp1);
|
|
|
|
AudioConnection patchCord2(amp1, delayExt1);
|
|
|
|
AudioConnection patchCord3(amp1, 0, mixer1, 1);
|
|
|
|
AudioConnection patchCord4(delayExt1, 0, mixer1, 0);
|
|
|
|
AudioConnection patchCord5(mixer1, 0, i2s1, 0);
|
|
|
|
AudioConnection patchCord6(mixer1, 0, i2s1, 1);
|
|
|
|
AudioControlSGTL5000 sgtl5000; //xy=943,541
|
|
|
|
// GUItool: end automatically generated code
|
|
|
|
|
|
|
|
|
|
|
|
void setup() {
|
|
|
|
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,100);
|
|
|
|
sine1.amplitude(1.0);
|
|
|
|
sine1.frequency(440);
|
|
|
|
sine1.phase(0.0);
|
|
|
|
mixer1.gain(0,0.5);
|
|
|
|
mixer1.gain(1,1.0);
|
|
|
|
amp1.gain(1.0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void loop() {
|
|
|
|
amp1.gain(1.0);
|
|
|
|
delay(200);
|
|
|
|
amp1.gain(0.0);
|
|
|
|
delay(2000);
|
|
|
|
}
|