I am writing GPS location data to an SD card in an Arduino project. It fails -


so writing gps data (latitude , longitude) sd card in arduino project. want write header kml file (which storing gps data). have 2 datafile.println commands (as shown below). can comment out 1 of lines , other line correctly written sd card. if have both lines datafile false (i assuming null?) , neither line below write sd card. doing wrong?

file datafile = sd.open(gps_file, file_write);  if (datafile) {  if (total == 0)  {      //write header      datafile.println("<\?xml version=\"1.0\" encoding=\"utf-8\"\?>"); //this line (by itself) write correctly      datafile.println("<kml xmlns=\"http://www.opengis.net/kml/2.2\">"); //this line (by itself) write correctly   } 

you can see project code @ link: my project code

try this:

 file datafile = sd.open("log.txt", file_write);   if (datafile) {     datafile.println(str);     datafile.close();     serial.println(str);   }   

i dont see close file...


Comments

Popular posts from this blog

html - Styling progress bar with inline style -

java - Oracle Sql developer error: could not install some modules -

How to use autoclose brackets in Jupyter notebook? -