Hello from Sweden.
I'm new to Teensy and Arduino but have programmed and worked with microcontrollers and electronics for many years.
Now I'm just trying to get started with an audio project and made a test sketch to get the first tones out of the Teensy.
I have connected an amplifier (and oscilloscope) to both A21 and A22 DAC outputs but it is completely silent running program as below.
Probably something basic I missed but maybe some one can see the problem and help me get on track.
Thanks
/Peter
I'm new to Teensy and Arduino but have programmed and worked with microcontrollers and electronics for many years.
Now I'm just trying to get started with an audio project and made a test sketch to get the first tones out of the Teensy.
I have connected an amplifier (and oscilloscope) to both A21 and A22 DAC outputs but it is completely silent running program as below.
Probably something basic I missed but maybe some one can see the problem and help me get on track.
Thanks
/Peter
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveform waveform1; //xy=177,362
AudioOutputAnalogStereo dacs; //xy=423,362
AudioConnection patchCord1(waveform1, 0, dacs, 0);
AudioConnection patchCord2(waveform1, 0, dacs, 1);
// GUItool: end automatically generated code
int led = 13;
void setup() {
pinMode(led, OUTPUT);
dacs.analogReference(INTERNAL);
waveform1.begin(30000,1750,WAVEFORM_SQUARE);
}
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
waveform1.frequency(1750);
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
waveform1.frequency(800);
delay(1000); // wait for a second
}