Extremely Slow Data Retrieval

So I am trying to get inputs via processing using the Arduino board and several potentiometers, and the inputs are coming in extremely slow. Is there any way to speed this up? Thanks!

Can you show us the sketch code, please?

Heres my code: Processing: import processing.serial.*;

Serial port;

int Width = 800; int Height = 800;

int x, y; double Kx = Width/255; double Ky = Height/255;

void setup(){ size (Width,Height); background(0); smooth(); port = new Serial(this, "COM5", 9600); } void draw(){ if (port.available()>0){ x = (int)(port.read()*Kx); y = (int)(port.read()*Ky); } strokeWeight(4); stroke(255); point(x,y); }

Arduino: int val1, val2; byte trans1, trans2;

void setup() { Serial.begin(9600); }

void loop() { val1 = analogRead(0); val2 = analogRead(1); trans1 = val1/4; trans2 = val2/4; Serial.print(trans1); Serial.print(trans2); delay(10); }

I would add a:- frameRate(60); to the setup.

Also move the plotting bit inside the conditional if() structure as you are plotting every time through the loop not at a time when new coordinates come in.

When posting code hit the has symbol in the reply box and paste the code between the two sets of braces that appear.