user11152: I'm trying to write into a file using this code from the example of the library:
String dataString = "";
int sensor = 0;
dataString += String(sensor);
dataString += ",";
sensor +=1;

File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
  dataFile.println(dataString);
  dataFile.close();
}

I have a char array that I want to write in the file, but it works only with String objects apparently. What can I do?

user15295: Try using dataFile.write(arrayName);
https://www.arduino.cc/en/Reference/FileWrite

11152: <p>I'm trying to write into a file using this code from the example of the library:</p>

<pre><code>String dataString = "";
int sensor = 0;
dataString += String(sensor);
dataString += ",";
sensor +=1;

File dataFile = SD.open("datalog.txt", FILE_WRITE);
if (dataFile) {
  dataFile.println(dataString);
  dataFile.close();
}
</code></pre>

<p>I have a char array that I want to write in the file, but it works only with String objects apparently. What can I do?</p>
 15295: <p>Try using <code>dataFile.write(arrayName);</code></p>

<p><a href="https://www.arduino.cc/en/Reference/FileWrite" rel="nofollow">https://www.arduino.cc/en/Reference/FileWrite</a></p>
