import processing.serial.*; Serial myPort; // Create object from Serial class int tmp,inByte; void setup() { size(640,480); //make our canvas 200 x 200 pixels big String portName = Serial.list()[1]; //change the 0 to a 1 or 2 etc. to match your port myPort = new Serial(this, portName, 9600); } void draw() { while (myPort.available() > 0) { inByte = myPort.read(); } translate(320,240); background(0,255,24); float rotx=float(inByte)*2*PI/255; println(rotx); rotate(-rotx); quad(-100,-100,-100,100,100,100,100,-100); }