|
Post by cherrypie on Jul 20, 2020 8:19:02 GMT
Hi there, i'm having trouble getting this Adafruit SD Card Breakout Board to work: learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorialOn my Arduino Uno this works without a problem, but on my ShieldBuddy (same Pins as on the Uno) the SD Card does not get recognized. I have the CS on Pin10. Has anyone ever had a working SD Card on a ShieldBuddy? I didn't find anything at least.Thanks for your help in advance! Cheers
|
|
|
Post by unseenart on Dec 2, 2023 14:18:44 GMT
*Sorry, English is not my first language.
Hi, dear administrator, is there any follow-up regarding this question posted? I also have trouble getting my 5V Micro SD Card Adapter to connect with the TC-275. I am not very sure how the connection between SD card and TC-275 even follows the instructions according to the manual. Is there any sample code available? I am using Arduino IDE 2.0
|
|
|
Post by unseenart on Dec 2, 2023 14:27:00 GMT
|
|
|
Post by unseenart on Dec 15, 2023 8:07:37 GMT
After some testing to use Spi channel 1 on p12 (MISO), p11(MOSI) and p13 (SCK) which also uses p10 as the slave select: I am using simple arduino uno compatible SD shield on TC-275. For me this code works, anyone facing this problem can try:
/* SD card read/write
#include <SD.h> #include <SPI.h> #define Serial SerialASC File myFile;
void setup() { // Open serial communications and wait for port to open: SPI.begin(BOARD_SPI_SS0_S1); Serial.begin(9600); pinMode(BOARD_SPI_SS0_S1,OUTPUT); while (!Serial) { ; // wait for serial port to connect. Needed for native USB port only }
Serial.print("Initializing SD card...");
if (!SD.begin(BOARD_SPI_SS0_S1)) { Serial.println("initialization failed!"); while (1); } Serial.println("initialization done."); SDwrite(); SDread();
}
void loop() { // nothing happens after setup }
void SDread(){ // re-open the file for reading: myFile = SD.open("test.txt",FILE_READ); if (myFile) { Serial.println("datalog.txt:");
// read from the file until there's nothing else in it: while (myFile.available()) { Serial.write(myFile.read()); } // close the file: myFile.close(); } else { // if the file didn't open, print an error: Serial.println("error opening test.txt"); } }
void SDwrite(){ // open the file. note that only one file can be open at a time, // so you have to close this one before opening another. myFile = SD.open("test.txt");
// if the file opened okay, write to it: if (myFile) { Serial.print("Writing to test.txt..."); myFile.println("testing 1, 2, 3."); // close the file: myFile.close(); Serial.println("Writing to test.txt sucessfully"); } else { // if the file didn't open, print an error: Serial.println("error opening test.txt"); } }
|
|
|
Post by unseenart on Dec 15, 2023 8:13:04 GMT
|
|