Advertisement
ShamelessName

mousePressed_1_0_Rev_II

Feb 1st, 2014
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import processing.serial.*;
  2.  
  3. Serial commsPort;
  4. char inputChar;
  5.  
  6. void setup()
  7. {
  8.   size(800,600);
  9.   background(0);
  10.   commsPort=new Serial(this, Serial.list()[1],38400);
  11. }
  12.  
  13. void draw()
  14. {
  15.   commsPort.write(inputChar);
  16.   println(inputChar);
  17.   if(mousePressed==true)
  18.   {
  19.     inputChar='1';
  20.   }
  21.   else
  22.   {
  23.     inputChar='0';
  24.   }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement