Complete the code to open the file for writing in CSV format.
File dataFile = SD.open([1], FILE_WRITE);
We open the file named data.csv to write CSV data.
Complete the code to write a comma separator between values in CSV.
dataFile.print(sensorValue); dataFile.print([1]); dataFile.println(temperature);
CSV uses commas to separate values, so we print a comma between values.
Fix the error in the code to close the file after writing data.
dataFile.[1]();We must close the file with close() to save data properly.
Fill both blanks to write a CSV header line with columns 'Time' and 'Value'.
dataFile.print([1]); dataFile.print([2]); dataFile.println();
The header line should be Time,Value with a comma separating columns.
Fill all three blanks to write sensor data with timestamp in CSV format.
dataFile.print([1]); dataFile.print([2]); dataFile.println([3]);
We write the current time from millis(), then a comma, then the sensor value.
