Use Teensy 3.6's SD Card

Status
Not open for further replies.

gfvalvo

Well-known member
Hi. I'd like to use the Audio library to play .wav files from the Teensy 3.6 SD card rather than the one on the Audio Shield. How do I tell it to use that interface rather than SPI0?

If there's already an example of doing this, please just point me in that direction.

Thanks.
 
Last edited:
Assuming you are using the Audio adaptor with the T3.6 to play the audio, it may be as simple as changing SD.begin() to use BUILTIN_SDCARD in the examples>Audio>WavFilePlayer
 
I'm not sure. Thinking maybe I have to instantiate a new SPI object since the T3.6's SD card is connected to a different SPI interface in the K66. Also, that SD card looks to be wired for both SD Mode and SPI Mode. Thinking I have to make that selection somewhere.
 
First, make sure you have the latest Teensyduino. All the audio lib examples which use the SD card were recently updated to document this. Just open File > Examples > Audio > WavFilePlayer or any of the others which use the SD card.
 
First, make sure you have the latest Teensyduino. All the audio lib examples which use the SD card were recently updated to document this. Just open File > Examples > Audio > WavFilePlayer or any of the others which use the SD card.
Can't get much easier than that. Thanks Paul.
 
Oops, spoke to soon. Updated from Teensyduino 1.35 to 1.36 and something unrelated broke. Verify operation can't find the function 'pow10f' when target board is a Teensy. Simple example:
Code:
void setup() {
  Serial.begin(115200);
  delay(2000);

  float a = pow10f(2.0);
  Serial.println(a);
}
void loop() {
}

Code:
Arduino: 1.6.12 (Windows 7), TD: 1.36, Board: "Teensy 3.2 / 3.1, Serial, 96 MHz (overclock), Faster, US English"

pow10: In function 'void setup()':
pow10:5: error: 'pow10f' was not declared in this scope
   float a = pow10f(2.0);

                       ^

'pow10f' was not declared in this scope

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Compiles fine for Adafruit M0 and ESP8266 Huzzah boards.
 
Yikes, that's a problem!

For a quick fix, put this in your code:

Code:
extern "C" float pow10f(float);

I've put this on the high priority list for 1.37.
 
Sorry to piggyback, but the problem calling pow10f is also affecting the OctoWS2811 SpectrumAnalyzer example code:

Code:
   logLevel = pow10f(n * -1.0 * (dynamicRange / 20.0));

returns this error:
Code:
SpectrumAnalyzer:135: error: 'pow10f' was not declared in this scope
     logLevel = pow10f(n * -1.0 * (dynamicRange / 20.0));

'pow10f' was not declared in this scope
Teensy 3.2, Arduino 1.8.2, Teensyduino 1.36, MacOS Sierra 10.12.4



Chief
 
Status
Not open for further replies.
Back
Top