The problem is that no matter what I do I cannot get any communication at all with the sd-slot. My guess is that the sd-slot is broken. But I don't know how to test that really so my secondary solution is as follows. Buy a second Arduino Uno and attach the below sd-shield:
And now to my question.
Can I connect my "gps-arduino" to my "sd-arduino" and send a complete nmea string or is that to much data per second so to speak?
I used the code from the documentation I found on the internet and it uses pin 10 I believe..?
#include <SD.h>
const int chipSelect = 10;
void setup()
{
Serial.begin(9600);
pinMode(10, OUTPUT);
if (!SD.begin(chipSelect)) {
Serial.print(F("Could not initialize sd-card!"));
return;
}
}
void loop()
{
// make a string for assembling the data to log:
char index = 0;
char temp = 0;
String dataString = "";
// open the file. note that only one file can be open at a time,
// so you have to close this one before opening another.
/*
while(Serial.available())
{
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if(dataFile)
{
temp = Serial.read();
dataString += String(temp);
dataFile.print(dataString);
dataString = "";
dataFile.close();
}
}
*/
File dataFile = SD.open("datalog.txt", FILE_WRITE);
if(dataFile)
{
while(Serial.available())
{
temp = Serial.read();
dataString += String(temp);
index++;
if(index>200)
break;
}
dataFile.print(dataString);
dataFile.close();
}
}
Have you formatted the SD with fat16lib's format utility? I would search for it, but the forum search is still broken and it is resorting to Google, which doesn't return very accurate results.
I have an opposite problem SD card worked but not gps, there is no data from the gps. x-ctu detected the usb port but unable to communicate with the modem.