Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import processing.serial.*;
Serial myPort;
float x;
int y;
void setup() {
size(700,500);
background(#FFFFFF);
myPort = new Serial(this, Serial.list()[1], 115200);
}
void draw() {
x += 0.5;
noStroke();
fill(#F7114F);
ellipse(x,width/2-y,1,1);
if(x > width){
x = 0;
background(#FFFFFF);
}
println(y);
}
void serialEvent(Serial myPort) {
y = myPort.read();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.