LanternMaker
New member
Hello,
I'm trying to use the audio features of my Teensy 3.6 and to begin, I am trying to make the most basic program to output sound using the computer's speakers, because I haven't bought the teensy sound card.
I used the design tool to connect one sine wave generator to both inputs of the USB output and pasted the code into Arduino editor. I have added some lines to make the onboard led blink and the code is here:
And the led blinks, but no sound is output. What am I doing wrong?
Before you ask I'm running windows 10, I have just updated my arduino program (1.8.5) and my Teenyduino (1.42). I have selected "Teensy 3.6", "Audio", "180MHz", "US english","Faster" in the Tools menu.
I'm trying to use the audio features of my Teensy 3.6 and to begin, I am trying to make the most basic program to output sound using the computer's speakers, because I haven't bought the teensy sound card.
I used the design tool to connect one sine wave generator to both inputs of the USB output and pasted the code into Arduino editor. I have added some lines to make the onboard led blink and the code is here:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
// GUItool: begin automatically generated code
AudioSynthWaveformSine sine1; //xy=350.1999969482422,248.1999969482422
AudioOutputUSB usb1; //xy=541.2000122070312,254.20001220703125
AudioConnection patchCord1(sine1, 0, usb1, 0);
AudioConnection patchCord2(sine1, 0, usb1, 1);
// GUItool: end automatically generated code
//used to blink the led to show that something is happening
int led=13;
void setup() {
// put your setup code here, to run once:
sine1.frequency(140);
sine1.amplitude(0.6);
pinMode(led, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
sine1.amplitude(0.6);
delay(1000);
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
sine1.amplitude(0.0);
delay(100);
}
And the led blinks, but no sound is output. What am I doing wrong?
Before you ask I'm running windows 10, I have just updated my arduino program (1.8.5) and my Teenyduino (1.42). I have selected "Teensy 3.6", "Audio", "180MHz", "US english","Faster" in the Tools menu.