joaotragtenberg
Active member
Hello, I am trying to use the DAC output on the teensy 3.2 and did not have success using it with the Audio System Design Tool.
It worked well with the analogWrite() method. I ran the "Simple DAC sine wave test code" I got from the https://www.pjrc.com/teensy/teensy31.html page.
I tried to make a simple DC1 blink to check with my multimeter (I can only use a multimeter in college) if the DAC is working but it wasn't.
I simply put one multimeter probe on the DAC/14 pin and another on GND and ran this code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformDc dc1; //xy=232,402
AudioOutputAnalog dac1; //xy=538,240
AudioConnection patchCord1(dc1, dac1);
// GUItool: end automatically generated code
void setup() {
pinMode(13, OUTPUT);
dac1.analogReference(EXTERNAL);
}
void loop() {
dc1.amplitude(1.0);
digitalWrite(13, HIGH); //I put the LED to blink just to make sure when the DAC voltage should go HIGH
delay(1000);
dc1.amplitude(-1.0);
digitalWrite(13, LOW);
delay(1000);
}
can anyone help me?
It worked well with the analogWrite() method. I ran the "Simple DAC sine wave test code" I got from the https://www.pjrc.com/teensy/teensy31.html page.
I tried to make a simple DC1 blink to check with my multimeter (I can only use a multimeter in college) if the DAC is working but it wasn't.
I simply put one multimeter probe on the DAC/14 pin and another on GND and ran this code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformDc dc1; //xy=232,402
AudioOutputAnalog dac1; //xy=538,240
AudioConnection patchCord1(dc1, dac1);
// GUItool: end automatically generated code
void setup() {
pinMode(13, OUTPUT);
dac1.analogReference(EXTERNAL);
}
void loop() {
dc1.amplitude(1.0);
digitalWrite(13, HIGH); //I put the LED to blink just to make sure when the DAC voltage should go HIGH
delay(1000);
dc1.amplitude(-1.0);
digitalWrite(13, LOW);
delay(1000);
}
can anyone help me?
Last edited: