Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 9 of 9

Thread: Can't get sound from propshield lc

  1. #1
    Junior Member
    Join Date
    Oct 2016
    Posts
    18

    Can't get sound from propshield lc

    Using Teensy 3.2 and propshiled lc, just trying to send some noise to a 4 ohm 3 watt speaker as a hardware test.
    I can hear the speaker click once the code is uploaded, but no noise signal thereafter.

    Here is the code:

    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>

    // GUItool: begin automatically generated code
    AudioSynthNoiseWhite noise1; //xy=346,213
    AudioOutputAnalog dac1; //xy=480,212
    AudioConnection patchCord1(noise1, dac1);

    // GUItool: end automatically generated code
    void setup(){
    pinMode(5, OUTPUT);
    digitalWrite(5, HIGH); // turn on the amplifier
    delay(10); // allow time to wake up
    }


    void loop() {
    // put your main code here, to run repeatedly:

    }

    Any pointers?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,313
    You're not giving the audio library any memory, so it can't do anything. Open any of the examples from File > Examples > Audio to see how AudioMemory() is used in setup.

    Also make sure you've got the DAC pin connected. It's not one of the 28 outside pins, so it's easy to overlook.

  3. #3
    Junior Member
    Join Date
    Oct 2016
    Posts
    18
    I ran a similar script where I added audio memory, and tried the sweep example editted to include:

    AudioOutputAnalog dac1; //xy=480,212
    AudioConnection patchCord1(noise1, dac1);

    Still got the same result.

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,313
    You need to post the complete program you tried. We can't help you figure out what's wrong with so little info. There's almost certainly some small detail not quite right, but nobody can know what it is.

    The way to get help here is to post a message where anyone reading can copy & paste your code into Arduino and run it on their board.

  5. #5
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,086
    I added the AudioMemory() and noise1.amplitude() to your sketch above and i get white noise out the speaker ...
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthNoiseWhite noise1; //xy=346,213
    AudioOutputAnalog dac1; //xy=480,212
    AudioConnection patchCord1(noise1, dac1);
    
    // GUItool: end automatically generated code
    void setup() {
      pinMode(5, OUTPUT);
      digitalWrite(5, HIGH); // turn on the amplifier
      AudioMemory(12);
      noise1.amplitude(0.5);
      delay(10); // allow time to wake up
    }
    
    
    void loop() {
      // put your main code here, to run repeatedly:
    
    }
    you need to jumper teensy DAC/A14 to the AudioIn on the shield.
    Last edited by manitou; 07-13-2017 at 08:52 PM.

  6. #6
    Junior Member
    Join Date
    Oct 2016
    Posts
    18
    Quote Originally Posted by manitou View Post
    I added the AudioMemory() and noise1.amplitude() to your sketch above and i get white noise out the speaker ...
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    // GUItool: begin automatically generated code
    AudioSynthNoiseWhite noise1; //xy=346,213
    AudioOutputAnalog dac1; //xy=480,212
    AudioConnection patchCord1(noise1, dac1);
    
    // GUItool: end automatically generated code
    void setup(){
    pinMode(5, OUTPUT);
    digitalWrite(5, HIGH); // turn on the amplifier
    AudioMemory(12);
    noise1.amplitude(0.5);
    delay(10); // allow time to wake up
    }
    
    
    void loop() {
    // put your main code here, to run repeatedly:
    
    }
    you need to jumper teensy DAC/A14 to the AudioIn on the shield.
    Still nothing.
    DAC/A14 to the Audio in on the shield.... ?? I am using the propshield LC, not the audio shield. Are we on the same page?

  7. #7
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,086
    Quote Originally Posted by Peter2708 View Post
    Still nothing.
    DAC/A14 to the Audio in on the shield.... ?? I am using the propshield LC, not the audio shield. Are we on the same page?
    Yes, look at the shield PCB illustration https://www.pjrc.com/store/prop_shield.html
    There is a an AudioIN hole just inside of pin 13 (not an edge pin). The teensy DAC pin needs to be jumpered to that. When the propshield is mounted on the T3.2, the AudioIN hole is above the DAC/A14 hole

    Click image for larger version. 

Name:	propshield_pinout.png 
Views:	45 
Size:	163.6 KB 
ID:	11003
    Last edited by manitou; 07-13-2017 at 10:41 PM.

  8. #8
    Junior Member
    Join Date
    Oct 2016
    Posts
    18
    A thousand thankyous. I will try that later

  9. #9
    Junior Member
    Join Date
    Oct 2016
    Posts
    18
    Like a charm. Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •