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

How to log sensor arduino data into a file.

$
0
0
I have been trying to log arduino data into a file but all i could get is an empty file,my code is here below,I need some assistance on how i could better it.
import processing.serial.*;
Serial mySerial;
PrintWriter output;
void setup() {
   mySerial = new Serial( this, Serial.list()[0], 9600 );
   output = createWriter( "timedg.csv" );
 
}
void draw() {
    if (mySerial.available() > 0 ) {
         String value = mySerial.readString();
         if ( value != null ) {
              output.println( value );
            

         }
    }
}

Viewing all articles
Browse latest Browse all 1768

Trending Articles