Light and Temperature Loggers fails to write to SD card

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
yellow12
 
Posts: 3
Joined: Tue Apr 01, 2014 8:46 am

Light and Temperature Loggers fails to write to SD card

Post by yellow12 »

Hi, I built the Light and Temperature logger project, to see if the shield / sd card were suitable for a project I'm planning. I also copied the sensor test sketch that goes with it. The circuit works fine and I get the results on the serial monitor, but alas nothing on the sd card. The card formats ok and works with the cardinfo sketch. Any thoughts?

Cheers

yellow12

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Light and Temperature Loggers fails to write to SD card

Post by adafruit_support_bill »

Do you get any error messages on the serial monitor when it tries to open the file?

yellow12
 
Posts: 3
Joined: Tue Apr 01, 2014 8:46 am

Re: Light and Temperature Loggers fails to write to SD card

Post by yellow12 »

adafruit_support_bill wrote:Do you get any error messages on the serial monitor when it tries to open the file?
No, serial monitor works fine, just nothing writes to sd card, which I've just tested using read write sketch

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Light and Temperature Loggers fails to write to SD card

Post by adafruit_support_bill »

Are you closing the file when you are done with it?

yellow12
 
Posts: 3
Joined: Tue Apr 01, 2014 8:46 am

Re: Light and Temperature Loggers fails to write to SD card

Post by yellow12 »

adafruit_support_bill wrote:Are you closing the file when you are done with it?
I am just unplugging the usb cable. I don't see a' write to file' to sd card in sketch.

User avatar
adafruit_support_bill
 
Posts: 88086
Joined: Sat Feb 07, 2009 10:11 am

Re: Light and Temperature Loggers fails to write to SD card

Post by adafruit_support_bill »

Unless you close the file or call "flush()" on it, the SD library will not write to the card until the block buffer fills up. This is by design (to reduce write cycles to the Flash memory on the SD card). But if you check the file before the first buffer is written, it will appear empty.
http://arduino.cc/en/Reference/SD

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”