lordgarth6
Member
Hi peeps, i have a question. iv been using the Audio System Design Tool for Teensy Audio Library (output below) and im trying to get it to output to the teensy 3.2's dac and also to a pwm pin to pulse an led in a sort of reaction. The led will need to go from like 25% lit to 100% using a dc offset mixed with the audio. i currently have the AudioOutputPWM as the pwm output but then im not sure how to set the pwm capable pin it outputs on, the info shows both pins 3 & 4 but the example just mentions pin 3. I can only use the one pin as the rest are used, i dont mind it being forced to pin 3.
Code:
// GUItool: begin automatically generated code
AudioPlaySdWav pwav;
AudioSynthWaveformDc dc_offset;
AudioMixer4 mixer;
AudioOutputAnalog audioout;
AudioMixer4 LEDmixer;
AudioSynthWaveformPWM audio_2_pwm;
AudioOutputPWM blue_led_pwm;
AudioConnection patchCord1(pwav, 0, mixer, 0);
AudioConnection patchCord2(pwav, 1, mixer, 1);
AudioConnection patchCord3(dc_offset, 0, LEDmixer, 1);
AudioConnection patchCord4(mixer, audioout);
AudioConnection patchCord5(mixer, 0, LEDmixer, 0);
AudioConnection patchCord6(LEDmixer, audio_2_pwm);
AudioConnection patchCord7(audio_2_pwm, blue_led_pwm);
// GUItool: end automatically generated code