import processing.serial.*; //set the background color int backgroundColor= 125; int fillColor = 255; //name the serial port for ref Serial myPort; //declare the x and y pos int xPos, yPos; void setup() { println(Serial.list()); myPort = new Serial(this, Serial.list()[1], 9600); size(255, 255); yPos = height/2; } void draw() { background(xPos,0,xPos-100); fill(xPos-150,xPos*xPos,xPos-100); smooth(); rectMode (CENTER); fill (200,0,0); ellipse (xPos, yPos, 70,40); fill (0); ellipse (xPos-11,yPos-9, 10,15); fill (200,0,0); rect (xPos+38,yPos,8,40); } //bring in serial info void serialEvent(Serial myPort) { //read the serial port and assign it to the x pos to fish xPos = myPort.read(); // print the serial data. println(xPos); }