From createWriter to saveToWeb?
in
Programming Questions
•
1 month ago
Hello,
Currently I am using "createWriter" to save 10 seconds worth data from an Arduino to a text file on my computer (milliseconds & analog pin reading). createWriter is great but it uses output.print, output.flush, etc. to save the data that has accumulated over the last 10 secs. However, I would like to upload this data to the internet via PHP and I have tried using "saveToWeb" but the data has to be either byte[] or string form and this is where the problem is. Does anyone know how I can go from createWriter to saveToWeb? How can I have 10 secs worth of data from two variables (milliseconds & analog pin reading) declared? Sorry if the idea/ my explanation is confusing!
Current code model:
output = createWriter("results.txt");
output.print(milliseconds + ";");
output.println(analogval + ";");
after 10 seconds...
output.flush();
output.close();
Data saved looks like:
(milliseconds;analog value;)
1;10;
10;10;
20;11;
30;10;
etc. all the way to 10,000 milliseconds
Thank you for any help on this problem!
Currently I am using "createWriter" to save 10 seconds worth data from an Arduino to a text file on my computer (milliseconds & analog pin reading). createWriter is great but it uses output.print, output.flush, etc. to save the data that has accumulated over the last 10 secs. However, I would like to upload this data to the internet via PHP and I have tried using "saveToWeb" but the data has to be either byte[] or string form and this is where the problem is. Does anyone know how I can go from createWriter to saveToWeb? How can I have 10 secs worth of data from two variables (milliseconds & analog pin reading) declared? Sorry if the idea/ my explanation is confusing!
Current code model:
output = createWriter("results.txt");
output.print(milliseconds + ";");
output.println(analogval + ";");
after 10 seconds...
output.flush();
output.close();
Data saved looks like:
(milliseconds;analog value;)
1;10;
10;10;
20;11;
30;10;
etc. all the way to 10,000 milliseconds
Thank you for any help on this problem!
1