Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import processing.serial.*;
- Serial commPort;
- int X = 0;
- int pX = 0;
- int Y = 0;
- int pY = 0;
- void setup()
- {
- //println(Serial.list());
- commPort = new Serial(this, Serial.list()[4], 9600);
- size(800, 600);
- background(255);
- }
- void draw()
- {
- Y = commPort.read();
- println(Y);adoad
- line(pX, pY, X, Y);
- pX = X;
- pY = Y;
- X++;
- if (X > 800) {
- X = 0;
- background(255);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment