bit og a late reply, but it if helps anyone else, I struggled first with slow updating, then I slowed the delay down on the arduino analogWrite. After that I struggled with flicker, I guess because there was no value in the serial message when Processing read it.
Anyway, I added a string to ignore values of -1 in my processing code
if (bgcolor!=-1) {background(bgcolor, 255, 255);
image(logo, 0, 0);
}
import processing.serial.*;
Serial myPort;
PImage logo;
int bgcolor =0;
void setup() {
colorMode(HSB,255);
logo = loadImage("http://arduino.cc/logo.png");
size(300,300);
println("Available Serial ports:");
println(Serial.list());
myPort= new Serial(this, Serial.list()[2],1200);
}
void draw() {
if (myPort.available()>1) {
bgcolor = myPort.read();
myPort.clear();
println(bgcolor);
}
if (bgcolor!=-1) {background(bgcolor, 255, 255);
image(logo, 0, 0);
}
}