Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : How to log sensor arduino data into a file.

$
0
0
Hey PhiLho,look at the code below and see if that is what you meant,i have tried it and it still gives me a blank file.I would suppose you post your code here.



import processing.serial.*;
Serial mySerial;
PrintWriter output;
void setup() {
   mySerial = new Serial( this, Serial.list()[0], 9600 );
   output = createWriter( "newp.txt" );
   //print(Serial.list());
}
void draw() {
    if (mySerial.available() > 0 ) {
         String value = mySerial.readString();
         if ( value != null ) {
              output.println( value );
               output.close();
             

         }
    }
 
}


Viewing all articles
Browse latest Browse all 1768

Trending Articles