Logging data to SD card from software serial I have an Arduino Uno and an Adafruit data logging shield and I have connected a digital pressure sensor that uses serial communication. The sensor requires a character to start transmitting data. I have managed to read the data using this code:

#include &lt;SoftwareSerial.h&gt; 
SoftwareSerial mySerial(8,9); 

int depth;

void setup() {

    Serial.begin(9600);
    mySerial.begin(9600);
    mySerial.print("C");

}

void loop() 
{

 if (mySerial.available()) {

   depth = mySerial.read();

 }

}


This returns the following:


  C1000
  C1000
  C1000


where 1000 is the value. 

I have written another code that logs data to the shield and tested with other sensors but I cannot log data from this sensor by modifying the above code and cannot find any relevant examples.
If I add something like this it does not return the same value.  

logfile.println(depth);


Complete newbie in so any suggestions are welcome.

UPDATE
use the C as the line start indicator. if received char is 'C' then do a file.println(); example with output to Serial

#include &lt;SoftwareSerial.h&gt; 
SoftwareSerial mySerial(8,9); 

void setup() {
    Serial.begin(9600);
    mySerial.begin(9600);
    mySerial.print("C");
}

void loop() {
 if (mySerial.available()) {
   char c = mySerial.read();
   if (c == 'C') {
     Serial.println();
   }
   Serial.write(c);
 }
}