jim lee
Well-known member
Read an SD card attached to a DFrobot_0669 Display.
I tried everything I could think of and could not get the Teensy to "see" the SD card. Failed on SD.begin() every time. Wire the thing to an Arduino UNO and presto! Worked first time.
I tried everything I could think of and could not get the Teensy to "see" the SD card. Failed on SD.begin() every time. Wire the thing to an Arduino UNO and presto! Worked first time.
C++:
#include <SD.h>
#define SD_CS 4
void setup() {
File testFile;
Serial.begin(9600);
delay(2000);
if (!SD.begin(SD_CS)) {
Serial.println("NO SD CARD!");
} else {
Serial.println("Looks like SD card worked!");
testFile = SD.open("mary.txt",FILE_READ);
char aChar;
while(testFile.available()) {
aChar = testFile.read();
Serial.print(aChar);
}
}
}
// During loop..
void loop() { }