ArtBus_analogIn

import processing.serial.*;
Serial port;
int newLine = 10;
String inData;
int shape;
 
void setup(){
  frameRate(30);
  size(300, 300);
  println(Serial.list());
  port = new Serial(this, Serial.list()[0], 115200);
  noStroke();
  rectMode(CENTER);
}
 
void draw(){
  background(255);
  port.write("!Fa1;");
  while (port.available() > 0) {
    inData = port.readStringUntil(newLine);
    if(inData != null){
      inData = trim(inData);
      //println(inData);
      shape = int(inData);
      //println(shape);
      fill(0,255,0);
      rect(width/2,height/2,shape,shape);
    }
  }
}