Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.serial.*;
- Serial commsPort;
- char inputChar;
- void setup()
- {
- size(800,600);
- background(0);
- commsPort=new Serial(this, Serial.list()[1],38400);
- }
- void draw()
- {
- commsPort.write(inputChar);
- println(inputChar);
- if(mousePressed==true)
- {
- inputChar='1';
- }
- else
- {
- inputChar='0';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement