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

Thread: AudioControlSGTL5000 problem

  1. #1
    Junior Member
    Join Date
    Mar 2017
    Posts
    4

    AudioControlSGTL5000 problem

    Hi all

    I started today to use teensy with audio shield and I went through the workshop pdf and video.
    I didn't connect the buttons and all as in the workshop but connected only the teensy to the audio shield.
    I came across a problem pretty early and I don't know what to do...
    I tried several audio tutorials and none of them played any sound . I tried the "blink_while_playing" tutorial to see whether I have problem with the connection between the teensy and the audio shield but there were no blinks.
    I went line by line in the code to figure out where is the problematic line and I found out that the code does nothing after "using" the AudioControlSGTL5000 variable in the setup.
    This is the code:
    Code:
    #include <Audio.h>
    #include <Wire.h>
    #include <SPI.h>
    #include <SD.h>
    #include <SerialFlash.h>
    
    AudioPlaySdWav           playSdWav1;
    AudioOutputI2S           audioOutput;
    AudioConnection          patchCord1(playSdWav1, 0, audioOutput, 0);
    AudioConnection          patchCord2(playSdWav1, 1, audioOutput, 1);
    AudioControlSGTL5000     sgtl5000_1;
    
    void setup() {
      Serial.begin(9600);
      delay(500);
      Serial.println("Hello");
      delay(500);
      Serial.println("World");
      delay(500);
      AudioMemory(8);
      Serial.println("Hello");
      delay(500);
      sgtl5000_1.enable();
      Serial.println("World");
      delay(500);
      sgtl5000_1.volume(0.45);
      SPI.setMOSI(7);
      SPI.setSCK(14);
      if (!(SD.begin(10))) {
        while (1) {
          Serial.println("Unable to access the SD card");
          delay(500);
        }
      }
      pinMode(13, OUTPUT); // LED on pin 13
      delay(1000);
    }
    
    void loop() {
      if (playSdWav1.isPlaying() == false) {
        Serial.println("Start playing");
        playSdWav1.play("SDTEST3.WAV");
        delay(10); // wait for library to parse WAV info
      }
    
      // print the play time offset
      Serial.print("Playing, now at ");
      Serial.print(playSdWav1.positionMillis());
      Serial.println(" ms");
    
      // blink LED and print info while playing
      digitalWrite(13, HIGH);
      delay(250);
      digitalWrite(13, LOW);
      delay(250);
    
      // read the knob position (analog input A2)
      /*
      int knob = analogRead(A2);
      float vol = (float)knob / 1280.0;
      sgtl5000_1.volume(vol);
      Serial.print("volume = ");
      Serial.println(vol);
      */
    }
    And this is the output:
    Code:
    Hello
    World
    Hello
    Do you know what seems to be the problem?

    Thanks,
    Elad

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,061
    Quote Originally Posted by EladAssia View Post
    Do you know what seems to be the problem?
    Very likely something isn't connected properly, almost certainly involving at least pins 18 & 19 (SDA & SCL).

    Please post a photo of how it's actually connected. Maybe we'll be able to see what's wrong?

  3. #3
    Junior Member
    Join Date
    Mar 2017
    Posts
    4
    Click image for larger version. 

Name:	IMG_7748.JPG 
Views:	62 
Size:	111.6 KB 
ID:	10100Click image for larger version. 

Name:	IMG_7749.JPG 
Views:	57 
Size:	175.0 KB 
ID:	10101Click image for larger version. 

Name:	IMG_7750.JPG 
Views:	47 
Size:	170.9 KB 
ID:	10102Click image for larger version. 

Name:	IMG_7751.JPG 
Views:	51 
Size:	195.8 KB 
ID:	10103Click image for larger version. 

Name:	IMG_7752.JPG 
Views:	55 
Size:	178.1 KB 
ID:	10104

    The audio shield is sitting over the teensy and they are connected through pins-socket (I checked with a multimeter and there is a connection between the start and ending of the socket).

    Thanks,
    Elad

  4. #4
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    23,061
    Everything I can see in these photos looks good.

    Are the pins actually soldered on the Teensy? That part is hidden from view...

  5. #5
    Junior Member
    Join Date
    Mar 2017
    Posts
    4
    No they are not. Should I solder them too?

  6. #6
    Junior Member
    Join Date
    Sep 2020
    Posts
    1

    Similar Issue

    Quote Originally Posted by PaulStoffregen View Post
    Everything I can see in these photos looks good.

    Are the pins actually soldered on the Teensy? That part is hidden from view...
    I am having a similar issue, everything is soldered, I have the SDTEST files on the SD card. I am able to play the .WAV files if I use the WavFilePlayer sketch. This sketch utilizes a while loop to wait for the song to complete. but the Blink while playing sketch does not work.

    Soldered the audio shield to the teensy, connections are good.

    If I take out the while loop the song plays the first half second then starts over.

    using REVD of the audio board and a 4.0.

    Thank you for any help you can provide!

Posting Permissions

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