Advertisement
Guest User

processing

a guest
Jul 23rd, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.41 KB | None | 0 0
  1. import cc.arduino.*;
  2.  
  3. import processing.serial.*;
  4.  
  5. Serial myPort;
  6.  
  7. void setup(){
  8.  
  9.   println(Serial.list());
  10.  
  11.   // Open the port you are using at the rate you want:
  12.   myPort = new Serial(this, Serial.list()[5], 57600);
  13.  
  14.   delay(1000);
  15.   myPort.write(1);
  16. }
  17.  
  18.  
  19. void draw(){}
  20.  
  21. void serialEvent(Serial myPort) {
  22.   // read String from the serial port:
  23.   int val = myPort.read();
  24.   println( val );
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement