Advertisement
Guest User

Untitled

a guest
Aug 27th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Serial.begin(9600);
  2.  
  3. Serial.println(value);
  4.  
  5. import processing.serial.*;
  6. Serial mySerial;
  7. PrintWriter output;
  8. void setup() {
  9. mySerial = new Serial( this, Serial.list()[0], 9600 );
  10. output = createWriter( "data.txt" );
  11. }
  12. void draw() {
  13. if (mySerial.available() > 0 ) {
  14. String value = mySerial.readString();
  15. if ( value != null ) {
  16. output.println( value );
  17. }
  18. }
  19. }
  20.  
  21. void keyPressed() {
  22. output.flush(); // Writes the remaining data to the file
  23. output.close(); // Finishes the file
  24. exit(); // Stops the program
  25. }
  26.  
  27. cat /dev/cu.usbmodem1d11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement