I use Arduino uno + SD shield and use external power, save data in sd card
but sometime I read SD card from PC , data write to SD card stop
how can I solve the question ? Thanks.
my code.
I don't know if this is your problem, but my rule for files is if you open a file, you should close it.
myFile = SD.open("test.txt", FILE_WRITE);
if (myFile) {
Serial.print("Writing to test.txt...");
Serial.println("done.");
// close the file here, just like below.
myFile.close();
} else {
Serial.println("error opening test.txt");
}
// with your sketch, myFile is still open from above
myFile = SD.open("test.txt");
if (myFile) {
Serial.println("test.txt:");
myFile.close();
} else {
Serial.println("error opening test.txt");
}
hi
my problem ,example..
i save data to SD card every second from Arduino
if it operation 30 min ,i should get 600 data
but i see SD card , maybe write 10min stopped
so i lose after 10 minutes of data
You should post your code. Your code above does not compile. No headers, no global variables, and my compiler does not like the "......" deal in the loop function.
Here are some of my other rules:
If the user thinks it isn't important enough to include, it probably is.
If the user says "don't worry about that", you probably should.
If the user says "it is taken care of", it probably isn't.
What kind of equipment are we discussing? What Arduino and SD device are you using?
And I would add some error checking. Change the loop to this, then upload and open the serial monitor. Does it still fail after 10 minutes? Does it always open the file?
Have you checked the +5v on the Arduino after the fail? Is it still +5v? That sounds like an overtemp shutdown on the voltage regulator. Is the regulator getting really hot?
Did you monitor the +5v pin on the Arduino during the test?
I would try a check to see if that is it. Remove the SD shield and run the blink example on the batteries. Does it fail after 10 minutes? Does the regulator still get as hot?
I think your CO meter may bring the total current usage up enough to cause you problems. This is just a guess. You could try disconnecting it and see if the problem goes away.