Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Serial.begin(9600);
- Serial.println(value);
- import processing.serial.*;
- Serial mySerial;
- PrintWriter output;
- void setup() {
- mySerial = new Serial( this, Serial.list()[0], 9600 );
- output = createWriter( "data.txt" );
- }
- void draw() {
- if (mySerial.available() > 0 ) {
- String value = mySerial.readString();
- if ( value != null ) {
- output.println( value );
- }
- }
- }
- void keyPressed() {
- output.flush(); // Writes the remaining data to the file
- output.close(); // Finishes the file
- exit(); // Stops the program
- }
- cat /dev/cu.usbmodem1d11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement